Show measured gateway latency on the README badge - #605
Conversation
The status badge sits in the top badge row and links the main-branch latency workflow. Docs now say the badge is included rather than awaiting README approval. Co-authored-by: Kion Fallah <kfallah@users.noreply.github.com>
|
@greptileai Please review this README badge insertion. The latency report itself already merged in #591 and stays Experiential-only. |
Greptile SummaryThe PR replaces the workflow-status badge with a numeric Shields endpoint showing representative gateway p50 request latency.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| .github/workflows/gateway-latency.yml | Generates and uploads the nested Shields payload, then publishes successful main-branch measurements to the badges branch. |
| exp/runtime/gateway/latency_badge.py | Defines the Shields schema and formats representative gateway p50 latency as a one-decimal millisecond value. |
| exp/runtime/gateway/latency_report.py | Adds optional badge output sourced directly from representative_run.gateway.p50_ms. |
| exp/runtime/gateway/latency_badge_test.py | Verifies metric selection, endpoint shape, formatting, validation, and README integration. |
| README.md | Displays the numeric gateway-latency Shields endpoint and links to main-branch workflow runs. |
| docs/reference/gateway-latency.md | Documents the measured gateway metric, artifact publication flow, stable endpoint, and initial branch-creation behavior. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
A[Push to main] --> B[Latency job]
B --> C[Generate full latency report]
B --> D[Generate Shields payload from representative gateway p50]
C --> E[Upload workflow artifact]
D --> E
E --> F[Publish badge job]
F --> G[badges/gateway-latency.json]
G --> H[Shields endpoint]
H --> I[README badge]
Reviews (2): Last reviewed commit: "Show representative gateway p50 on the R..." | Re-trigger Greptile
…ark. Successful ubuntu-latest runs on main write representative p50 gateway-added latency to a Shields endpoint on the badges branch. The README renders that millisecond value instead of a workflow pass/fail image. Co-authored-by: Kion Fallah <kfallah@users.noreply.github.com>
|
@greptileai Please re-review |
The Shields endpoint now reads representative_run.gateway.p50_ms and publishes badges/gateway-latency.json. The badge label is gateway latency with a millisecond message such as 22.2 ms. Co-authored-by: Kion Fallah <kfallah@users.noreply.github.com>
|
@greptileai Please re-review |
Summary
The README badge shows the latest representative gateway p50 request latency from the Experiential-only mock benchmark on
main. The value comes fromrepresentative_run.gateway.p50_msin the generated report, not from a difference versus the mock and not from a workflow pass/fail image.The badge label is
gateway latency. The message is formatted like22.2 ms.How it updates
gateway-latency.jsonand the Shields endpoint asshields/gateway-latency.json. Both stay in the uploaded artifact.pushtomainon ubuntu-latest,publish-badgepublishesgateway-latency.jsonto thebadgesbranch.workflow_dispatch(including the 32-core runner) still measure and keep the artifact. They do not publish the badge.main. Thebadgesbranch does not trigger gate, latency, or package workflows.GITHUB_TOKENpushes also do not start new workflow runs.Seeded public endpoint
The
badgesbranch is live now, seeded from the latest successful main artifact (run 32608210921). That report'srepresentative_run.gateway.p50_msis28.365618999998787, which the PR formatter publishes as28.4 ms.mainwas not modified.Verified:
https://raw.githubusercontent.com/experientiallabs/experiential/badges/gateway-latency.jsonreturns Shields schemaVersion 1 with"message": "28.4 ms"https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fexperientiallabs%2Fexperiential%2Fbadges%2Fgateway-latency.jsonreturns an SVG labeledgateway latency: 28.4 msREADME image:
Verification
uv run pytest -q exp/runtime/gateway/latency_badge_test.py exp/runtime/gateway/latency_report_test.py exp/runtime/gateway/latency_measure_test.pyuv run ruff check . && uv run ruff format --check . && uv run ty check