simvue-io / simvue-io/python-api

Support sending gzipped request bodies

Open
#923 1 comment 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.