| 58 | // ── Aggregated Bench Metrics ─────────────────────────────────────── |
| 59 | |
| 60 | export interface BenchMetrics { |
| 61 | /** Per-iteration timing distribution */ |
| 62 | timing: TimingStats; |
| 63 | /** Memory before the measured loop */ |
| 64 | memBefore: MemorySnapshot; |
| 65 | /** Memory after the measured loop */ |
| 66 | memAfter: MemorySnapshot; |
| 67 | /** Peak memory observed during the loop */ |
| 68 | memPeak: MemorySnapshot; |
| 69 | /** RSS growth during the measured loop (KB). */ |
| 70 | rssGrowthKb: number; |
| 71 | /** heapUsed growth during the measured loop (KB). */ |
| 72 | heapUsedGrowthKb: number | null; |
| 73 | /** |
| 74 | * Estimated memory growth slope (KB / iteration), if the scenario collects samples. |
| 75 | * `null` if not measured. |
| 76 | */ |
| 77 | rssSlopeKbPerIter: number | null; |
| 78 | /** See rssSlopeKbPerIter. */ |
| 79 | heapUsedSlopeKbPerIter: number | null; |
| 80 | /** True/false if slope is evaluated against a stability threshold, else null. */ |
| 81 | memStable: boolean | null; |
| 82 | /** CPU time consumed by the measured loop */ |
| 83 | cpu: CpuUsage; |
| 84 | /** Number of measured iterations (excludes warmup) */ |
| 85 | iterations: number; |
| 86 | /** Total wall-clock time for the measured loop (ms) */ |
| 87 | totalWallMs: number; |
| 88 | /** Operations per second */ |
| 89 | opsPerSec: number; |
| 90 | /** Frames or writes delivered (for async pipelines) */ |
| 91 | framesProduced: number; |
| 92 | /** Total bytes produced (drawlist or ANSI) */ |
| 93 | bytesProduced: number; |
| 94 | /** |
| 95 | * PTY bytes observed by the parent process for this run (if measured). |
| 96 | * Useful when framework-local byte counters are unavailable. |
| 97 | */ |
| 98 | ptyBytesObserved: number | null; |
| 99 | } |
| 100 | |
| 101 | // ── Result Envelope ──────────────────────────────────────────────── |
| 102 |
nothing calls this directly
no outgoing calls
no test coverage detected