Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions benchmarks/perp-fees.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ providers:
# paneled (it duplicates the headline) and $10k reads within noise of
# $1k on every venue, so the panels show the two sizes where the story
# changes: $100k and $1M.
panel_main_label: All-in at $1k
metric_panels:
- id: all_in_100k
label: All-in at $100k
Expand Down
4 changes: 2 additions & 2 deletions src/components/benchmark-body.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@
// not only on the timeseries view. Providers the panel has no value
// for (book could not fill the tier) drop out of the ranking, which
// is the skipped-not-extrapolated rule made visible.
const panelViewBenchmark = useMemo(() => {

Check failure on line 543 in src/components/benchmark-body.tsx

View workflow job for this annotation

GitHub Actions / check

React Hook "useMemo" is called conditionally. React Hooks must be called in the exact same order in every component render. Did you accidentally call a React Hook after an early return?
if (!activePanel) return viewBenchmark;
const vals = activePanel.values ?? {};
return {
Expand Down Expand Up @@ -720,7 +720,7 @@
return tabPanels.length > 0 ? (
<MetricViewTabs
panels={tabPanels}
mainLabel={benchmark.metric}
mainLabel={benchmark.panelMainLabel ?? benchmark.metric}
activeId={activePanelId}
onSelect={setActivePanelId}
/>
Expand Down Expand Up @@ -767,7 +767,7 @@
return tabPanels.length > 0 ? (
<MetricViewTabs
panels={tabPanels}
mainLabel={benchmark.metric}
mainLabel={benchmark.panelMainLabel ?? benchmark.metric}
activeId={activePanelId}
onSelect={setActivePanelId}
/>
Expand Down
4 changes: 4 additions & 0 deletions src/lib/spec-schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@ export const SpecSchema = z
* frontends bench to surface execution quality, outage signal, taker
* share, etc. without changing the main p50 headline.
*/
/* Label for the headline tab of the metric panel switcher. Defaults
* to `metric`; set it when the panels are size/window variants and
* the headline needs its variant spelled out (e.g. "All-in at $1k"). */
panel_main_label: z.string().min(1).max(80).optional(),
metric_panels: z
.array(
z.object({
Expand Down
1 change: 1 addition & 0 deletions src/types/benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ export type Benchmark = {
* below the main table. Populated by the spec loader from
* `metric_panels` in the YAML. */
metricPanels?: MetricPanel[];
panelMainLabel?: string;
/** Optional per-bench relabeling of the ledger's aggregate columns.
* Declared by benches whose unit has no percentile semantics (the
* p50/p90/p99/mean slots are repurposed, e.g. USD revenue leaderboards)
Expand Down
Loading