mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-03 19:03:30 +07:00
Labels
No labels
needs-format
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Niko1221/Strata#4003
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Niko1221/Strata/pull/2359
Author: @nekomario28
Created: 10/14/2026
Status: ❌ Closed
Base:
main← Head:prometheus-scrape-window📝 Commits (1)
6a23c91serve: average the throughput gauges over the window between scrapes (#2341)📊 Changes
2 files changed (+49 additions, -6 deletions)
View changed files
📝
serve/server.py(+16 -6)📝
serve/test_server.py(+33 -0)📄 Description
Closes #2341.
/metrics/prometheusexposedllamacpp:prompt_tokens_secondsandllamacpp:predicted_tokens_secondsastotal_tokens / total_secondsover the server's lifetime, so a server idle for hours still advertised e.g. 58 tok/s, with nothing in the text format to say how old the number was.llama.cpp does not do that under those names. Both rates come from
server_metrics::bucket(tools/server/server-common.h), which a scrape resets — "the gauges are averaged over the window between two scrapes" (tools/server/server-context.cpp) — andbucket::n_per_second()returns0.0when the window is empty. So the same dashboard that decays to0against llama.cpp froze at the last request's speed against Strata.The
*_totalcounters stay cumulative; only the two gauges now come from a bucket held across scrapes, exposed as the delta. The HELP text says which window they cover.Testing
python -m unittest serve.test_server.PrometheusMetricsThe new case sends one request, scrapes, then scrapes again with no traffic in between and requires
(0, 0)for the two gauges whilellamacpp:tokens_predicted_totalstays put. Against the old code that second scrape returns the frozen(602.5, 50.0)(the failure is in the report), so the case is a real guard rather than a restatement.python -m unittest discover -s serve -t . -p 'test_*.py'— 770 tests,OK (skipped=8), with this checkout'srequirements.txtinstalled (a bare system Python was missingregex, which is unrelated to the change).🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.