Skip to content

Commit 3bfa32e

Browse files
committed
refactor: tuck report metric explainers into callouts
1 parent 3c38d0b commit 3bfa32e

2 files changed

Lines changed: 114 additions & 74 deletions

File tree

modules/local/render_benchmark_report/bin/benchmark_report_template.html

Lines changed: 110 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,18 @@ <h2 id="run-metrics"><svg class="h-icon sm"><use href="#ic-chart"/></svg> Run me
277277
</div>
278278

279279
<h2 id="methodology"><svg class="h-icon sm"><use href="#ic-table"/></svg> Methodology &mdash; what each utilization metric means</h2>
280-
<p class="section-desc">
281-
The report exposes <strong>three utilization metric families</strong>. They sound similar
282-
but measure very different things, and in practice they disagree by 2&ndash;5&times;.
283-
Read this before comparing rows in the run-metrics table above.
284-
</p>
285-
<table class="info-table" id="methodology-table">
280+
<p class="section-desc">Reference definitions for utilization metrics and CPU-time accounting.</p>
281+
<div class="callout">
282+
<div class="callout-header" onclick="this.nextElementSibling.classList.toggle('show')">
283+
&#9432; How to interpret utilization metrics
284+
</div>
285+
<div class="callout-body" style="overflow-x:auto">
286+
<p class="section-desc">
287+
The report exposes <strong>three utilization metric families</strong>. They sound similar
288+
but measure very different things, and in practice they disagree by 2&ndash;5&times;.
289+
Read this before comparing rows in the run-metrics table above.
290+
</p>
291+
<table class="info-table" id="methodology-table">
286292
<thead>
287293
<tr>
288294
<th style="width:22%">Metric</th>
@@ -339,102 +345,133 @@ <h2 id="methodology"><svg class="h-icon sm"><use href="#ic-table"/></svg> Method
339345
</tr>
340346
</tbody>
341347
</table>
342-
<p class="section-desc" style="margin-top:8px">
343-
<strong>How to read them:</strong>
344-
<em>Trace efficiency</em> tells you whether users are requesting too much CPU/memory per task.
345-
<em>Sched allocation</em> tells you how well the scheduler packs and reuses VMs.
346-
<em>Real VM efficiency</em> is the end-to-end ground truth: what fraction of the VM-hours
347-
you paid for were actually spent doing work. Trace efficiency &times; Sched allocation
348-
&asymp; Real VM efficiency (modulo time-weighting).
349-
</p>
350-
<p class="section-desc">
351-
VM-level metrics require a <code>machines.jsonl</code> in the JSONL bundle.
352-
Runs without machine data show &mdash; for those columns.
353-
</p>
354-
<p class="section-desc" style="margin-top:8px">
355-
<strong>CPU time columns in the run table:</strong>
356-
<em>Total Trace CPU Time (Task)</em> is &Sigma;<sub>tasks</sub>(cpus<sub>req</sub> &middot; realtime), so it reflects
357-
what tasks asked for, not what they actually used.
358-
<em>Total VM CPU Time</em> is &Sigma;<sub>VMs</sub>(vCPU &middot; lifetime), the capacity you paid for.
359-
Those two can be close while Trace CPU efficiency stays low, because Trace CPU efficiency compares
360-
<em>used</em> CPU against <em>requested</em> CPU, not requested CPU against VM capacity.
361-
</p>
348+
<p class="section-desc" style="margin-top:8px">
349+
<strong>How to read them:</strong>
350+
<em>Trace efficiency</em> tells you whether users are requesting too much CPU/memory per task.
351+
<em>Sched allocation</em> tells you how well the scheduler packs and reuses VMs.
352+
<em>Real VM efficiency</em> is the end-to-end ground truth: what fraction of the VM-hours
353+
you paid for were actually spent doing work. Trace efficiency &times; Sched allocation
354+
&asymp; Real VM efficiency (modulo time-weighting).
355+
</p>
356+
<p class="section-desc">
357+
VM-level metrics require a <code>machines.jsonl</code> in the JSONL bundle.
358+
Runs without machine data show &mdash; for those columns.
359+
</p>
360+
<p class="section-desc" style="margin-top:8px">
361+
<strong>CPU time columns in the run table:</strong>
362+
<em>Total Trace CPU Time (Task)</em> is &Sigma;<sub>tasks</sub>(cpus<sub>req</sub> &middot; realtime), so it reflects
363+
what tasks asked for, not what they actually used.
364+
<em>Total VM CPU Time</em> is &Sigma;<sub>VMs</sub>(vCPU &middot; lifetime), the capacity you paid for.
365+
Those two can be close while Trace CPU efficiency stays low, because Trace CPU efficiency compares
366+
<em>used</em> CPU against <em>requested</em> CPU, not requested CPU against VM capacity.
367+
</p>
368+
</div>
369+
</div>
362370
</div>
363371

364372
<!-- 3. Process overview -->
365373
<div class="section" id="process-overview">
366374
<h1><svg class="h-icon"><use href="#ic-process"/></svg> Process overview</h1>
367-
<p class="section-desc">
368-
<strong>Summary</strong><br>
369-
This section provides a comparison of the process-level metrics for each pipeline
370-
across the groups. The plots show the run time distribution per process.
371-
Dots represent mean values per process across all tasks.
372-
Error bars indicate mean &plusmn; 1 standard deviation.
373-
A single point indicates that a single task was executed for the process.
374-
</p>
375-
<p class="section-desc">
376-
<strong>Run time</strong> = Staging time + real time
377-
</p>
375+
<p class="section-desc">Compare process-level runtime distributions across the included groups.</p>
376+
<div class="callout">
377+
<div class="callout-header" onclick="this.nextElementSibling.classList.toggle('show')">
378+
&#9432; How process runtime is measured
379+
</div>
380+
<div class="callout-body">
381+
<p class="section-desc">
382+
<strong>Summary</strong><br>
383+
This section provides a comparison of the process-level metrics for each pipeline
384+
across the groups. The plots show the run time distribution per process.
385+
Dots represent mean values per process across all tasks.
386+
Error bars indicate mean &plusmn; 1 standard deviation.
387+
A single point indicates that a single task was executed for the process.
388+
</p>
389+
<p class="section-desc">
390+
<strong>Run time</strong> = Staging time + real time
391+
</p>
392+
</div>
393+
</div>
378394
<div id="process-sections"></div>
379395
</div>
380396

381397
<!-- 4. Combined task runtime -->
382398
<div class="section" id="combined-task-runtime">
383399
<h1><svg class="h-icon"><use href="#ic-chart"/></svg> Combined task runtime</h1>
384-
<p class="section-desc">
385-
<strong>Summary</strong><br>
386-
Combined task duration by process, split per pipeline and group. Includes scheduling overhead (submit to start).
387-
</p>
400+
<p class="section-desc">Combined task duration by process, split per pipeline and group.</p>
401+
<div class="callout">
402+
<div class="callout-header" onclick="this.nextElementSibling.classList.toggle('show')">
403+
&#9432; What is included in combined task runtime
404+
</div>
405+
<div class="callout-body">
406+
<p class="section-desc">
407+
<strong>Summary</strong><br>
408+
Combined task duration by process, split per pipeline and group. Includes scheduling overhead (submit to start).
409+
</p>
410+
</div>
411+
</div>
388412
<div id="combined-runtime-panels" class="runtime-panels"></div>
389413
</div>
390414

391415
<!-- 5. Task overview -->
392416
<div class="section" id="task-overview">
393417
<h1><svg class="h-icon"><use href="#ic-task"/></svg> Task overview</h1>
394-
<p class="section-desc">
395-
<strong>Summary</strong><br>
396-
This section provides an overview of task-level metrics for instance usage and runtime metrics.
397-
</p>
418+
<p class="section-desc">Overview of task-level instance usage and runtime distributions.</p>
398419

399420
<h2 id="task-instance-usage"><svg class="h-icon sm"><use href="#ic-instance"/></svg> Task instance usage</h2>
400421
<p class="section-desc">Number of tasks per instance type, grouped by pipeline run group.</p>
401422
<div class="chart" id="chart-instance-usage" style="height:500px"></div>
402423

403424
<h2 id="task-metrics"><svg class="h-icon sm"><use href="#ic-scatter"/></svg> Task metrics</h2>
404-
<p class="section-desc">
405-
This section provides a comparison between staging and run times for tasks.<br>
406-
<strong>Wait time</strong>: time from submission to task start.<br>
407-
<strong>Staging time</strong>: time to stage/unstage before and after execution.<br>
408-
<strong>Real time</strong>: time to execute the task.
409-
</p>
425+
<p class="section-desc">Compare wait, staging, and real-time distributions for tasks.</p>
426+
<div class="callout">
427+
<div class="callout-header" onclick="this.nextElementSibling.classList.toggle('show')">
428+
&#9432; How task timing is measured
429+
</div>
430+
<div class="callout-body">
431+
<p class="section-desc">
432+
This section provides a comparison between staging and run times for tasks.<br>
433+
<strong>Wait time</strong>: time from submission to task start.<br>
434+
<strong>Staging time</strong>: time to stage/unstage before and after execution.<br>
435+
<strong>Real time</strong>: time to execute the task.
436+
</p>
437+
</div>
438+
</div>
410439
<div id="task-sections"></div>
411440
</div>
412441

413442
<!-- 6. Performance gains -->
414443
<div class="section" id="performance-gains">
415444
<h1><svg class="h-icon"><use href="#ic-benchmark"/></svg> Performance gains</h1>
416-
<p class="section-desc">
417-
<strong>Summary</strong><br>
418-
Decomposes the VM capacity-hours you paid for into <em>used</em> vs <em>wasted</em>,
419-
and attributes the waste to the three responsibilities the Seqera scheduler
420-
owns: <strong>VM provisioning</strong> (choosing instance types), <strong>packing</strong>
421-
(which task on which VM and when), and <strong>task rightsizing</strong>
422-
(trimming user-requested CPU/Memory before submitting to ECS, when prediction
423-
is enabled).
424-
</p>
425-
<p class="section-desc">
426-
<strong>Four quantities, per run</strong><br>
427-
<em>VM capacity</em>: &Sigma;<sub>VMs</sub>&nbsp;(vCPU &middot; lifetime). What you paid for.<br>
428-
<em>User requested</em>: &Sigma;<sub>tasks</sub>&nbsp;(cpus<sub>config</sub> &middot; realtime). Nextflow-directive request per task &times; active time.<br>
429-
<em>Scheduler booked</em>: schedAllocCpuEfficiency &middot; VM capacity. What actually went to ECS as <code>cpuShares</code>.<br>
430-
<em>Used</em>: &Sigma;<sub>tasks</sub>&nbsp;(pcpu/100 &middot; realtime). Actual work done.
431-
</p>
432-
<p class="section-desc">
433-
<strong>How the scheduler's three jobs show up</strong><br>
434-
&nbsp;&nbsp;&nbsp;&mdash; <em>Rightsizing</em> shrinks <code>scheduler booked</code> below <code>user requested</code>.<br>
435-
&nbsp;&nbsp;&nbsp;&mdash; <em>Packing</em> shrinks the gap between <code>scheduler booked</code> and <code>VM capacity</code>.<br>
436-
&nbsp;&nbsp;&nbsp;&mdash; <em>Provisioning</em> shrinks <code>VM capacity</code> itself (picking smaller/cheaper instances).
437-
</p>
445+
<p class="section-desc">Capacity mix and savings attribution across CPU and memory.</p>
446+
<div class="callout">
447+
<div class="callout-header" onclick="this.nextElementSibling.classList.toggle('show')">
448+
&#9432; How savings attribution is measured
449+
</div>
450+
<div class="callout-body">
451+
<p class="section-desc">
452+
<strong>Summary</strong><br>
453+
Decomposes the VM capacity-hours you paid for into <em>used</em> vs <em>wasted</em>,
454+
and attributes the waste to the three responsibilities the Seqera scheduler
455+
owns: <strong>VM provisioning</strong> (choosing instance types), <strong>packing</strong>
456+
(which task on which VM and when), and <strong>task rightsizing</strong>
457+
(trimming user-requested CPU/Memory before submitting to ECS, when prediction
458+
is enabled).
459+
</p>
460+
<p class="section-desc">
461+
<strong>Four quantities, per run</strong><br>
462+
<em>VM capacity</em>: &Sigma;<sub>VMs</sub>&nbsp;(vCPU &middot; lifetime). What you paid for.<br>
463+
<em>User requested</em>: &Sigma;<sub>tasks</sub>&nbsp;(cpus<sub>config</sub> &middot; realtime). Nextflow-directive request per task &times; active time.<br>
464+
<em>Scheduler booked</em>: schedAllocCpuEfficiency &middot; VM capacity. What actually went to ECS as <code>cpuShares</code>.<br>
465+
<em>Used</em>: &Sigma;<sub>tasks</sub>&nbsp;(pcpu/100 &middot; realtime). Actual work done.
466+
</p>
467+
<p class="section-desc">
468+
<strong>How the scheduler's three jobs show up</strong><br>
469+
&nbsp;&nbsp;&nbsp;&mdash; <em>Rightsizing</em> shrinks <code>scheduler booked</code> below <code>user requested</code>.<br>
470+
&nbsp;&nbsp;&nbsp;&mdash; <em>Packing</em> shrinks the gap between <code>scheduler booked</code> and <code>VM capacity</code>.<br>
471+
&nbsp;&nbsp;&nbsp;&mdash; <em>Provisioning</em> shrinks <code>VM capacity</code> itself (picking smaller/cheaper instances).
472+
</p>
473+
</div>
474+
</div>
438475

439476
<h2 id="pg-cpu-mix"><svg class="h-icon sm"><use href="#ic-chart"/></svg> Capacity mix (CPU)</h2>
440477
<p class="section-desc">Each bar spans the total VM vCPU-hours paid for. Segments show how those hours were spent.</p>

modules/local/render_benchmark_report/tests/test_render.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,14 @@ def test_render_html(tmp_path, minimal_report_data):
3434
assert "Trace efficiency (task)" in text
3535
assert "Sched allocation (VM)" in text
3636
assert "Real VM efficiency (VM)" in text
37-
assert "three utilization metric families" in text
37+
assert "How to interpret utilization metrics" in text
3838
assert "Total Trace CPU Time (Task)" in text
3939
assert "Total VM CPU Time" in text
4040
assert "schedAllocCpuEfficiency" in text
4141
assert "realVmCpuEfficiency" in text
42+
assert "How process runtime is measured" in text
43+
assert "How task timing is measured" in text
44+
assert "How savings attribution is measured" in text
4245
# VM metric charts
4346
assert 'id="chart-vm-alloc-cpu"' in text
4447
assert 'id="chart-vm-alloc-mem"' in text

0 commit comments

Comments
 (0)