Skip to content

Python(feat): batch measurement upload - #810

Draft
alexluck-sift wants to merge 4 commits into
mainfrom
al/python/feat/batch-measurements
Draft

alexluck-sift wants to merge 4 commits into
mainfrom
al/python/feat/batch-measurements

Conversation

@alexluck-sift

@alexluck-sift alexluck-sift commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Replaying a test-results log batches consecutive measurement creates into one CreateTestMeasurements call instead of one call per measurement. On a 13,631-line log this cut the calls from 13,628 to 4,021 and the upload from about 12 minutes to about 3.5; step creates and updates still take one call each.

  • A crash mid-upload now loses up to one batch (100 measurements) of progress instead of one, in exchange for the fewer round trips.
  • A batch create that fails with an ambiguous gRPC status (the response was lost, not necessarily the request) is retried safely: the retry checks the server by test step, name, timestamp, and value before recreating anything, and reports the recovery once per run via the new SiftReplayReconciledWarning.

@alexluck-sift
alexluck-sift changed the base branch from main to al/python/fix/pytest-update-with-no-mask October 1, 2026 00:40
@alexluck-sift
alexluck-sift added this pull request to stack #811 October 1, 2026 00:40
Base automatically changed from al/python/fix/pytest-update-with-no-mask to main October 1, 2026 16:55
A test-results log records one CreateTestMeasurement line per measurement, and
replay sent one request for each. Measurements are the bulk of a log, so a
large log took one round trip per measurement to upload.

Replay now coalesces a run of consecutive measurement lines into one
CreateTestMeasurements call. A run ends at the next non-measurement line, at
the size guard, or at the end of the log, so lines still reach the server in
log order and the cursor advances by the whole run once its call returns.

On a 13,631-line log this takes the requests from 13,628 to 4,021, and the
upload from about 12 minutes to about 3.5 at a 53ms round trip. The sidecar is
written once per run rather than once per line, which cuts its cost with them.

The log format does not change, so a log written by an earlier version gets the
same speedup. Step creates and updates still take one request each.
@alexluck-sift
alexluck-sift force-pushed the al/python/feat/batch-measurements branch from 658e6a3 to 07f59ad Compare October 14, 2026 18:43
@github-actions

github-actions Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-810/

Deployed from fc25d10. The link may take up to a minute to become live as GitHub Pages propagates.

@alexluck-sift alexluck-sift changed the title Al/python/feat/batch measurements Python(feat): batch measurement upload Oct 14, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant