simvue-io / simvue-io/python-api

Support sending gzipped request bodies

未关闭
#923 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
Python
星标
4
派生
1
平均合并
5 天 8 小时
30 天内合并 PR
4

描述

Whenever there is a large amount of content the Python API should gzip the body and include the following header:

"Content-Encoding": "gzip"

This should be done for:

  • Sending large numbers of runs, i.e. "loadSim"
  • Sending scalar or non-scalar metrics
  • Sending events

In the requests post you can just do:

data=gzip.compress(msgpack.packb(data, use_bin_type=True))

or

data=gzip.compress(json.dumps(data).encode("utf-8"))

as appropriate. Obviously don't use json=... any more in requests.post(...), use data=... instead.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 loadSim、标量和非标量指标以及事件的 Python API 请求路径入手,重点查看其中的 requests.post 调用以及当前的 JSON 或 msgpack payload。完成标准是:对于全部三个操作,适用的大型请求体使用带 gzip 压缩的 data=,并发送 Content-Encoding: gzip 标头。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
api
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。