Skip to content

Dashboard: show time and tok/s at the cursor on the decode chart - #626

Open
jvmenen wants to merge 2 commits into
youssofal:mainfrom
jvmenen:feat/dashboard-tps-cursor-value
Open

jvmenen wants to merge 2 commits into
youssofal:mainfrom
jvmenen:feat/dashboard-tps-cursor-value

Conversation

@jvmenen

@jvmenen jvmenen commented Oct 13, 2026

Copy link
Copy Markdown
Contributor

Why

On the Overview tab, hovering the "Decode TPS (last 5 min)" chart draws the crosshair but shows no number. The chart hides the uPlot legend, so there is no place where the value under the cursor appears. To read the tok/s at a dip or a peak you have to estimate it from the y axis.

What changes

  • lib/uplotTooltip.ts (new): a small uPlot plugin, cursorValueTooltip(formatValue), that puts a label next to the crosshair.
  • TPSTimeSeries.tsx: one line that turns the plugin on, formatting values as NN.N tok/s.
  • Bundle: the served bundle is rebuilt in a separate commit.

How it works, in plain terms

On every cursor move the plugin looks up, for each visible series, the data point nearest to the cursor and shows the time and that value, with a dot in the series colour. It searches outwards from the hovered index and only accepts points within 40 px, because a series with gaps or sparse dots (such as completed requests next to live samples) is often empty at the exact index under the cursor. When no series has a point that close, no label is shown. Near the right edge the label flips to the left of the crosshair so it stays inside the plot. The legend stays hidden and nothing else about the chart changes.

Tests

  • tsc -b && vite build passes.
  • Checked in the browser against a running server: the label follows the cursor with the time and the value, shows both series where a completed request sits next to the live line, flips at the right edge, and disappears over empty stretches.
  • bun test was not run here (bun is not installed on this machine); the change adds no props or hooks that the existing uplotAxis.test.ts mocks.

Jeroen van Menen added 2 commits October 13, 2026 00:06
The decode TPS chart hides the uPlot legend, so the crosshair showed no value.
A small uPlot plugin now puts a label next to the cursor with the time and the
value of each visible series, taken from the nearest point within 40 px (live
samples and completed requests sit at different times, so the exact index is
often empty for one of them). The label flips to the left near the right edge.
The bundled SPA in mtplx/dashboard/_static needs a rebuild to pick this up.

This branch has not been deployed

No deployments
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