Skip to content

feat(viz): rework the benchmark report's controls, axes and export - #4

Open
4D0R wants to merge 1 commit into
mainfrom
viz/report-readability
Open

feat(viz): rework the benchmark report's controls, axes and export#4
4D0R wants to merge 1 commit into
mainfrom
viz/report-readability

Conversation

@4D0R

@4D0R 4D0R commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

What

Reworks the generated HTML report (benchmark/visualize.go). No change to
benchmark execution, the JSONL schema, or the CLI.

Axes

  • The latency axis follows the rolling percentile lines that are drawn,
    rather than raw per-request extremes, and stays put when layers are
    toggled — ticking a layer reveals a line instead of rescaling the chart.
  • Cache-mix bands reserve their own vertical space, so another layer can no
    longer draw through them.
  • Totals get a right-hand axis in token units, present only while the layer
    is shown, replacing an unlabelled 0-1 fraction that shared the latency
    scale.

Requests layer

  • Draws a p10-p90 spread band per arm where individual dots would overplot,
    falling back to dots once the view is zoomed in enough to read them. The
    threshold is evaluated once per chart, so arms cannot render in different
    styles at the same zoom.
  • Dots no longer depend on the line toggles.

Controls

  • Select All / Deselect All act on the plotted layers; variant selection
    moved into the filter modal beside the checkboxes it controls, where it
    previously drove a widget in another panel and appeared to do nothing.
  • A single state-render pass keeps legend, modal and summary consistent.
  • Labels renamed (Response Time / TTLT, no Show prefix).
  • Errors and Totals now start unchecked, so a freshly opened report shows the
    latency lines without the ingest area over them.
  • Removed the variant filter text box (the legend and the filter modal
    already cover variant visibility) and the per-tick x-axis value rows.

Help

  • Custom tooltip replaces native title: styled, prompt, keyboard reachable,
    and not clipped by a scrolling panel. The affordance is a dotted underline
    on the label rather than an added glyph.

Zoom

  • Esc exits a zoom. Double-click retained; Reset Zoom button removed.

Export

  • CSV of per-request rows and of the summary, scoped to the current view
    (zoom window, hidden arms, filters), with a commented provenance header.
    Generated client side, so a report that has been copied elsewhere still
    yields its data without network access.

Testing

  • gofmt, go vet, and the suite under -race.
  • The emitted script is exercised by the Node-backed tests in
    benchmark/visualize_samples_test.go.
  • Checked in a browser against a generated report: control state propagation,
    tooltip placement and keyboard paths, Esc precedence, axis stability
    across layer permutations, the band/dots threshold, and CSV row counts and
    scoping.

Notes

  • benchmark/visualize_samples_test.go drops assertions for the removed
    x-axis-values control and updates two label strings.
    TestNoDatasetAxisRowsJS keeps its real assertion — that the cache-mix
    overlay must not grow the bottom margin — now that the bottom margin is a
    fixed constant.
  • The CSV carries the fields embedded in the report, a subset of the JSONL;
    the header says so and points to the full CSV written alongside a run.

- name response time as TTLT; drop "Show " from control labels
- derive the latency axis from the drawn percentile lines, and hold it
  steady when layers are toggled
- reserve space for the cache-mix bands so other layers can't cross them
- give totals a right-hand axis in token units, shown with the layer
- draw requests as a p10-p90 band, falling back to individual dots once
  the view is zoomed in enough to read them
- split Select All between layers and variants, and sync the legend,
  modal and summary from one state pass
- replace native title help with a styled, keyboard-reachable tooltip
- exit zoom with Esc; drop the Reset Zoom button
- export per-request and summary CSV from the report itself
- start with errors and totals off; drop the variant filter box and the
  per-tick x-axis value rows
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