Skip to content

Show measured gateway latency on the README badge - #605

Merged
kfallah merged 3 commits into
mainfrom
cursor/gateway-latency-report-a764
Aug 23, 2026
Merged

Show measured gateway latency on the README badge#605
kfallah merged 3 commits into
mainfrom
cursor/gateway-latency-report-a764

Conversation

@kfallah

@kfallah kfallah commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Summary

The README badge shows the latest representative gateway p50 request latency from the Experiential-only mock benchmark on main. The value comes from representative_run.gateway.p50_ms in 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 like 22.2 ms.

How it updates

  1. The latency job writes the full report as gateway-latency.json and the Shields endpoint as shields/gateway-latency.json. Both stay in the uploaded artifact.
  2. After a successful push to main on ubuntu-latest, publish-badge publishes gateway-latency.json to the badges branch.
  3. Pull requests and workflow_dispatch (including the 32-core runner) still measure and keep the artifact. They do not publish the badge.
  4. Publishing does not push to protected main. The badges branch does not trigger gate, latency, or package workflows. GITHUB_TOKEN pushes also do not start new workflow runs.

Seeded public endpoint

The badges branch is live now, seeded from the latest successful main artifact (run 32608210921). That report's representative_run.gateway.p50_ms is 28.365618999998787, which the PR formatter publishes as 28.4 ms. main was not modified.

Verified:

  • https://raw.githubusercontent.com/experientiallabs/experiential/badges/gateway-latency.json returns 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.json returns an SVG labeled gateway latency: 28.4 ms

README image:

[![gateway latency](https://img.shields.io/endpoint?url=https%3A%2F%2Fraw.githubusercontent.com%2Fexperientiallabs%2Fexperiential%2Fbadges%2Fgateway-latency.json)](https://github.com/experientiallabs/experiential/actions/workflows/gateway-latency.yml?query=branch%3Amain)

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.py
  • uv run ruff check . && uv run ruff format --check . && uv run ty check
Open in Web Open in Cursor 

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>
@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

@greptileai Please review this README badge insertion. The latency report itself already merged in #591 and stays Experiential-only.

@greptile-apps

greptile-apps Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR replaces the workflow-status badge with a numeric Shields endpoint showing representative gateway p50 request latency.

  • Generates the badge payload from representative_run.gateway.p50_ms.
  • Uploads the report and endpoint payload from latency runs.
  • Publishes successful main measurements to the badges branch.
  • Updates the README and gateway-latency documentation for the numeric badge.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

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]
Loading

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>
@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

@greptileai Please re-review 4438d181. The README badge is now a numeric Shields endpoint for representative p50 gateway-added latency, published only after a successful main benchmark.

@cursor cursor Bot changed the title Add the gateway latency workflow badge to README Show measured gateway overhead on the README badge Aug 23, 2026
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>
@cursor

cursor Bot commented Aug 23, 2026

Copy link
Copy Markdown

@greptileai Please re-review ec5bd88d. The README badge now shows representative gateway p50 request latency from representative_run.gateway.p50_ms, published as badges/gateway-latency.json.

@cursor cursor Bot changed the title Show measured gateway overhead on the README badge Show measured gateway latency on the README badge Aug 23, 2026
@kfallah
kfallah merged commit 9082a40 into main Aug 23, 2026
15 checks passed
@kfallah
kfallah deleted the cursor/gateway-latency-report-a764 branch August 23, 2026 00:51
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.

2 participants