Dashboard: add a prompt processing tok/s chart

Sits between generation tok/s and KV cache in a three-chart row
(stacks on narrow screens), with the same hover readout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QaE1hpvyZTJixEbUUMj9Ca
This commit is contained in:
neil 2026-11-02 05:03:07 -08:00
parent 85912dd3b2
commit c4b54b4abd

View file

@ -11,7 +11,7 @@
--accent: #3b6ef5; --accent-weak: #e6edfe; --accent: #3b6ef5; --accent-weak: #e6edfe;
--ok: #1f9d55; --ok-weak: #e3f5ea; --warn: #b7791f; --warn-weak: #fbf1dc; --ok: #1f9d55; --ok-weak: #e3f5ea; --warn: #b7791f; --warn-weak: #fbf1dc;
--bad: #d64545; --bad-weak: #fbe5e5; --bad: #d64545; --bad-weak: #fbe5e5;
--c1: #3b6ef5; --c2: #0f9d8a; --c3: #c2620f; --c4: #d13d5e; --c5: #8a5cf0; --c1: #3b6ef5; --c2: #0f9d8a; --c3: #c2620f; --c4: #d13d5e; --c5: #8a5cf0; --c6: #2f9e44;
--mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
color-scheme: light; color-scheme: light;
} }
@ -22,7 +22,7 @@
--accent: #6d93ff; --accent-weak: #1c2640; --accent: #6d93ff; --accent-weak: #1c2640;
--ok: #3ccf7f; --ok-weak: #143022; --warn: #e3a94a; --warn-weak: #33280f; --ok: #3ccf7f; --ok-weak: #143022; --warn: #e3a94a; --warn-weak: #33280f;
--bad: #f07272; --bad-weak: #3a1818; --bad: #f07272; --bad-weak: #3a1818;
--c1: #6d93ff; --c2: #3fc9b4; --c3: #f0954a; --c4: #f2708c; --c5: #a98bff; --c1: #6d93ff; --c2: #3fc9b4; --c3: #f0954a; --c4: #f2708c; --c5: #a98bff; --c6: #5fd27a;
color-scheme: dark; color-scheme: dark;
} }
} }
@ -96,8 +96,7 @@ button.danger { color: var(--bad); }
.bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; } .bar i { display: block; height: 100%; background: var(--accent); width: 0; transition: width .4s; }
.charts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; } .charts { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 14px; }
.charts.two { grid-template-columns: repeat(2, minmax(0, 1fr)); } @media (max-width: 820px) { .charts { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 820px) { .charts, .charts.two { grid-template-columns: minmax(0, 1fr); } }
.chart .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; } .chart .head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 6px; }
.chart .head span { font-size: 12px; color: var(--muted); } .chart .head span { font-size: 12px; color: var(--muted); }
.chart .head b { font-size: 13px; font-variant-numeric: tabular-nums; } .chart .head b { font-size: 13px; font-variant-numeric: tabular-nums; }
@ -180,8 +179,9 @@ pre {
<div class="tile"><div class="k">Prefix cache hits</div><div class="v" id="t-prefix">—</div><div class="s">prompt tokens reused</div></div> <div class="tile"><div class="k">Prefix cache hits</div><div class="v" id="t-prefix">—</div><div class="s">prompt tokens reused</div></div>
</div> </div>
<div class="grid charts two"> <div class="grid charts">
<div class="panel chart"><div class="head"><span>Generation tok/s</span><b id="c-gen-v"></b></div><svg id="c-gen" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div> <div class="panel chart"><div class="head"><span>Generation tok/s</span><b id="c-gen-v"></b></div><svg id="c-gen" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div>
<div class="panel chart"><div class="head"><span>Prompt processing tok/s</span><b id="c-prompt-v"></b></div><svg id="c-prompt" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div>
<div class="panel chart"><div class="head"><span>KV cache %</span><b id="c-kv-v"></b></div><svg id="c-kv" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div> <div class="panel chart"><div class="head"><span>KV cache %</span><b id="c-kv-v"></b></div><svg id="c-kv" viewBox="0 0 300 90" preserveAspectRatio="none"></svg><div class="axis"><span>10 min ago</span><span>now</span></div></div>
</div> </div>
<div class="grid charts"> <div class="grid charts">
@ -338,6 +338,7 @@ function render(s) {
const h = s.history || []; const h = s.history || [];
chartTimes = h.map((p) => p.t); chartTimes = h.map((p) => p.t);
chart("c-gen", h.map((p) => p.gen), "var(--c1)", null, (v) => fmt.n(v, 0) + " tok/s"); chart("c-gen", h.map((p) => p.gen), "var(--c1)", null, (v) => fmt.n(v, 0) + " tok/s");
chart("c-prompt", h.map((p) => p.prompt), "var(--c6)", null, (v) => fmt.n(v, 0) + " tok/s");
chart("c-util", h.map((p) => p.util), "var(--c2)", 100, (v) => fmt.pct(v)); chart("c-util", h.map((p) => p.util), "var(--c2)", 100, (v) => fmt.pct(v));
chart("c-kv", h.map((p) => p.kv), "var(--c3)", null, (v) => fmt.n(v, 1) + "%"); chart("c-kv", h.map((p) => p.kv), "var(--c3)", null, (v) => fmt.n(v, 1) + "%");
// Fixed scales so the shape means something: 0–100 °C, and 0 to the board power limit. // Fixed scales so the shape means something: 0–100 °C, and 0 to the board power limit.