Skip to content

fix: 7D/30D chart shows 0.0s on latency benches - #1694

Merged
Flotapponnier merged 3 commits into
devfrom
fix/series-7d-30d-unit-double-conversion
Jul 29, 2026
Merged

fix: 7D/30D chart shows 0.0s on latency benches#1694
Flotapponnier merged 3 commits into
devfrom
fix/series-7d-30d-unit-double-conversion

Conversation

@Flotapponnier

Copy link
Copy Markdown
Collaborator

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.

  • The blob stores latency values in milliseconds (OCB internal convention for unit: s)
  • /api/series was dividing values by 1000 before sending — originally added for the video renderer, which expects seconds and appends the unit label directly
  • The time-series chart received values already in seconds, then fmtUnit(value, "s") divided by 1000 again → 0.2 s became 0.0002 s → displayed as "0.0 s"

The same double-conversion existed for bps benches (divided by 100 in API → fmtUnit divides by 100 again).

Fix: add ?raw=1 query param to /api/series that bypasses all unit conversions. The chart always passes raw=1 (values stay in the internal ms/bp convention that fmtUnit expects). The video renderer omits raw=1 and keeps receiving display-friendly seconds/percent values.

Files changed

  • src/app/api/series/[slug]/route.ts?raw=1 skips the / 1000 and / 100 conversions
  • src/components/time-series-chart/index.tsx — all 3 lazy-fetch buildQs helpers now include raw: "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"
  • Same for any other unit: s bench with 7D/30D data
  • Video renderer still works (it doesn't pass raw=1)
  • 1H / 24H tabs unaffected (they use benchmark.extras.series24h directly, not this API)

🤖 Generated with Claude Code

@Flotapponnier
Flotapponnier merged commit 5f281fa into dev Jul 29, 2026
1 check failed
@Flotapponnier
Flotapponnier deleted the fix/series-7d-30d-unit-double-conversion branch July 29, 2026 17:50
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.

1 participant