fix: 7D/30D chart shows 0.0s on latency benches - #1694
Merged
Conversation
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.
Summary
On benches with
unit: s(e.g. aggregator-head-lag), switching to the 7D or 30D time range showed all Y-axis labels and tooltip values as "0.0 s" despite the chart lines rendering at clearly different heights.Root cause: double division by 1000.
unit: s)/api/serieswas dividing values by 1000 before sending — originally added for the video renderer, which expects seconds and appends the unit label directlyfmtUnit(value, "s")divided by 1000 again →0.2 sbecame0.0002 s→ displayed as "0.0 s"The same double-conversion existed for
bpsbenches (divided by 100 in API →fmtUnitdivides by 100 again).Fix: add
?raw=1query param to/api/seriesthat bypasses all unit conversions. The chart always passesraw=1(values stay in the internal ms/bp convention thatfmtUnitexpects). The video renderer omitsraw=1and keeps receiving display-friendly seconds/percent values.Files changed
src/app/api/series/[slug]/route.ts—?raw=1skips the/ 1000and/ 100conversionssrc/components/time-series-chart/index.tsx— all 3 lazy-fetchbuildQshelpers now includeraw: "1"Test plan
aggregator-head-lag?chain=base→ 7D and 30D tabs should now show real values (e.g. "0.2 s", "1.3 s") not "0.0 s"unit: sbench with 7D/30D dataraw=1)benchmark.extras.series24hdirectly, not this API)🤖 Generated with Claude Code