simvue-io / simvue-io/python-api
Support sending gzipped request bodies
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4
- Forks
- 1
- Avg merge
- 5d 8h
- Merged PRs (30d)
- 4
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the Python API request paths for loadSim, scalar and non-scalar metrics, and events, focusing on their requests.post calls and current JSON or msgpack payloads. Done means the applicable large request bodies use data= with gzip compression and send the Content-Encoding: gzip header for all three operations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100