Repository navigation
fix(trend): a rising error rate is the regression - #566
Merged
Merged
Conversation
detectRegressions treated every metric but latency as higher-is-better. For errorRate that is backwards: a run going from 0.25 to 0.75 against the baseline was not flagged, and an error-free run was flagged as a regression. The error rate now joins latency as higher-is-worse. The book's trend section now says which direction counts for each metric.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Audit finding 10 (2026-10-29).
TrendService.detectRegressionstreated every metric except latency as higher-is-better. ForerrorRatethat is backwards. Against a baseline of 0.3125, a run whose error rate rose to 0.75 was not flagged, and an error-free run (0, -100%) was flagged as the regression. Sokates trend errorRatehid real regressions and raised alarms on improvements.What changed
errorRatenow joins the latencies as higher-is-worse: a run is flagged when it is more than 20% above the baseline. Throughput is unchanged (flagged when more than 20% below).computeBrokerTrendreads the sameReportSummarymetrics through the samedetectRegressions, so the broker trend'serrorRateis fixed too. That rule exists only inTrendService.BaselineServicehas its own rule forerrorRate(+0.001) and is untouched.docs/book/11-api-reference.md, Trend Analysis: one sentence saying which direction counts for each metric. Nothing said it before.TrendService.java(53-54,185-189incli/cmd/mcp_caveats.go) sits above the edit, so it doesn't move.Tests
TrendServiceTest.aRisingErrorRateIsTheRegression: four LOAD runs with 1/4, 1/4, 3/4 and 0/4 failed tasks. The 0.75 run is the only regression. Without the fix the test fails, flagging the error-free run instead.Local runs:
cd kates && ./mvnw test -Dquarkus.grpc.codegen.skip=true -Dquarkus.http.test-port=0: BUILD SUCCESS, 1789 tests, 0 failures, 0 errors, 3 skippedspotless:check(JDK 25): cleancd cli && go test -count=1 ./cmd -run TestMCPCaveat: passscripts/check-book-style.sh: OKOnly CI can run the integration tests, the native image, Docker, CodeQL and the Quarto book render.
Deliberately not done