ostia 0.2.12 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -358
  3. package/docs/agent-protocol.md +210 -0
  4. package/docs/cli.md +1196 -0
  5. package/docs/config.md +233 -0
  6. package/docs/document-schema.md +224 -0
  7. package/docs/library.md +421 -0
  8. package/docs/preload-recipes.md +169 -0
  9. package/docs/statistics.md +218 -0
  10. package/index.d.ts +894 -677
  11. package/package.json +16 -14
  12. package/src/ab/ab-runner.ts +474 -0
  13. package/src/ab/index.ts +1086 -0
  14. package/src/baseline/index.ts +75 -0
  15. package/src/bench/index.ts +462 -0
  16. package/src/bench/projects.ts +39 -0
  17. package/src/bench/range.ts +27 -0
  18. package/src/bench/registry.ts +424 -0
  19. package/src/bench/run-tasks.ts +176 -0
  20. package/src/bench/run.ts +51 -0
  21. package/src/bench/runner.ts +147 -0
  22. package/src/bench/support.ts +161 -0
  23. package/src/bench/sweep.ts +39 -0
  24. package/src/cache/fingerprint.ts +59 -0
  25. package/src/cache/store.ts +28 -0
  26. package/src/capture/bunflags.ts +91 -0
  27. package/src/capture/cpu-parse.ts +119 -0
  28. package/src/capture/cpu.ts +44 -0
  29. package/src/capture/frames.ts +54 -0
  30. package/src/capture/heap-parse.ts +86 -0
  31. package/src/capture/heap.ts +32 -0
  32. package/src/capture/inspector.ts +46 -0
  33. package/src/capture/jsc-parse.ts +167 -0
  34. package/src/capture/jsc.ts +35 -0
  35. package/src/capture/sampling.ts +5 -0
  36. package/src/ci/index.ts +416 -0
  37. package/src/cli/flags.ts +264 -0
  38. package/{chunk-9sx15b08.js → src/cli/help.ts} +23 -11
  39. package/src/cli/main.ts +18 -0
  40. package/src/cli/output.ts +185 -0
  41. package/src/cli/run.ts +1110 -0
  42. package/src/compare/index.ts +617 -0
  43. package/src/config/index.ts +275 -0
  44. package/src/config/validate.ts +267 -0
  45. package/src/errors.ts +8 -0
  46. package/src/format.ts +36 -0
  47. package/src/glob.ts +48 -0
  48. package/src/index.ts +62 -0
  49. package/src/ir/cpu.ts +10 -0
  50. package/src/ir/document.ts +471 -0
  51. package/src/ir/fp.ts +31 -0
  52. package/src/ir/git.ts +36 -0
  53. package/src/ir/types.ts +615 -0
  54. package/src/measure/alloc.ts +57 -0
  55. package/src/measure/cpu.ts +99 -0
  56. package/src/measure/environment.ts +41 -0
  57. package/src/measure/inprocess.ts +191 -0
  58. package/src/measure/instructions.ts +133 -0
  59. package/src/measure/loop.ts +57 -0
  60. package/src/measure/noise.ts +55 -0
  61. package/src/measure/paired.ts +312 -0
  62. package/src/measure/peak.ts +202 -0
  63. package/src/measure/timing.ts +263 -0
  64. package/src/profile.ts +109 -0
  65. package/src/renderers/collapsed.ts +35 -0
  66. package/src/renderers/cpu-tree.ts +183 -0
  67. package/src/renderers/cpuprofile.ts +43 -0
  68. package/src/renderers/format.ts +142 -0
  69. package/src/renderers/index.ts +27 -0
  70. package/src/renderers/json.ts +10 -0
  71. package/src/renderers/jsonl.ts +15 -0
  72. package/src/renderers/markdown.ts +525 -0
  73. package/src/renderers/mermaid.ts +78 -0
  74. package/src/renderers/minimal.ts +602 -0
  75. package/src/renderers/paired.ts +229 -0
  76. package/src/renderers/relative.ts +64 -0
  77. package/src/renderers/select.ts +286 -0
  78. package/src/renderers/speedscope.ts +69 -0
  79. package/src/renderers/terminal.ts +466 -0
  80. package/src/renderers/types.ts +27 -0
  81. package/src/spawn/index.ts +396 -0
  82. package/src/stats/bootstrap.ts +153 -0
  83. package/src/stats/index.ts +140 -0
  84. package/src/stats/mannwhitney.ts +81 -0
  85. package/src/time.ts +325 -0
  86. package/src/version.ts +3 -0
  87. package/ab-runner.ts +0 -8
  88. package/chunk-05jfst35.js +0 -28
  89. package/chunk-1g1x9zz2.js +0 -15
  90. package/chunk-23g2rwrn.js +0 -3
  91. package/chunk-468h5412.js +0 -25
  92. package/chunk-4esjfc2m.js +0 -2
  93. package/chunk-ct2xsezd.js +0 -14
  94. package/cli.js +0 -3
  95. package/index.js +0 -2
  96. package/runner.ts +0 -7
@@ -0,0 +1,466 @@
1
+ import { formatDuration, pickDurationUnit } from "../format.ts";
2
+ import { cpuSampleCount } from "../ir/cpu.ts";
3
+ import type {
4
+ AbSummary,
5
+ ProfileDocument,
6
+ Warning,
7
+ Workload,
8
+ } from "../ir/types.ts";
9
+ import {
10
+ cpuTimes,
11
+ formatCpuTimes,
12
+ formatEnvironmentLine,
13
+ formatHeapSummary,
14
+ formatInstructions,
15
+ formatNsAsMs,
16
+ formatRelative,
17
+ formatSignedPct,
18
+ formatSpan,
19
+ formatUsAsMs,
20
+ labelOrId,
21
+ topSelfFrames,
22
+ workloadLabel,
23
+ } from "./format.ts";
24
+ import {
25
+ abNotes,
26
+ abRows,
27
+ alsoHeader,
28
+ formatAbHeader,
29
+ formatAbSummary,
30
+ formatNewSuites,
31
+ formatThrew,
32
+ memoryCells,
33
+ memoryRows,
34
+ pairedCells,
35
+ } from "./paired.ts";
36
+ import {
37
+ groupOf,
38
+ labelInGroup,
39
+ relativeRatios,
40
+ type TimingRow,
41
+ } from "./relative.ts";
42
+ import {
43
+ comparedRows,
44
+ environmentMismatch,
45
+ memoryColumns,
46
+ memoryReadings,
47
+ noSampleRuns,
48
+ oneSidedNote,
49
+ rowComparisonWarnings,
50
+ runWarnings,
51
+ shownFrameDeltas,
52
+ shownHeapDeltas,
53
+ shownMemoryDeltas,
54
+ skippedWorkloads,
55
+ thresholdNote,
56
+ timingRuns,
57
+ workloadsById,
58
+ } from "./select.ts";
59
+ import type { Renderer, RenderResult } from "./types.ts";
60
+
61
+ const TOP_FRAMES = 5;
62
+ const TOP_TYPES = 5;
63
+ const MIN_MEMORY_WIDTH = 10;
64
+
65
+ interface Column<R> {
66
+ header: string;
67
+ width: number;
68
+ cell: (data: R) => string;
69
+ }
70
+
71
+ interface TableRow<R> {
72
+ label: string;
73
+ group?: string;
74
+ /** Absent when there is nothing to tabulate; `status` says why. */
75
+ data?: R;
76
+ /** The row's text when `data` is absent: `skipped` or `no samples`. */
77
+ status?: string;
78
+ warnings: Warning[];
79
+ }
80
+
81
+ function textTable<R>(columns: Column<R>[], rows: TableRow<R>[]): string[] {
82
+ const indentOf = (row: TableRow<R>) => (row.group !== undefined ? " " : "");
83
+ // Under its group's header, a row shows the task name alone.
84
+ const shown = (row: TableRow<R>) => labelInGroup(row.label, row.group);
85
+ let labelWidth = 4;
86
+ for (const r of rows) {
87
+ labelWidth = Math.max(labelWidth, indentOf(r).length + shown(r).length);
88
+ }
89
+ const header = `${"Task".padEnd(labelWidth)} ${columns.map((c) => c.header.padEnd(c.width)).join(" ")}`;
90
+ const lines = [header, "-".repeat(header.length)];
91
+ let lastGroup: string | undefined;
92
+ for (const row of rows) {
93
+ if (row.group !== undefined && row.group !== lastGroup) {
94
+ lines.push(`${row.group}:`);
95
+ }
96
+ lastGroup = row.group;
97
+ const indent = indentOf(row);
98
+ const label = (indent + shown(row)).padEnd(labelWidth);
99
+ const data = row.data;
100
+ lines.push(
101
+ data === undefined
102
+ ? `${label} - ${row.status}`
103
+ : `${label} ${columns.map((c) => c.cell(data).padEnd(c.width)).join(" ")}`,
104
+ );
105
+ if (row.warnings.length > 0) {
106
+ lines.push(`${indent} ! ${row.warnings.map((w) => w.code).join(", ")}`);
107
+ }
108
+ }
109
+ return lines;
110
+ }
111
+
112
+ function warningFootnotes(rows: TableRow<unknown>[]): string[] {
113
+ const lines = rows.flatMap((row) =>
114
+ row.warnings.map((w) => ` ${row.label}: ${w.message}`),
115
+ );
116
+ return lines.length > 0 ? ["", "Warnings:", ...lines] : [];
117
+ }
118
+
119
+ function finish(lines: string[]): RenderResult {
120
+ return { text: `${lines.map((l) => l.trimEnd()).join("\n")}\n` };
121
+ }
122
+
123
+ export const terminalRenderer: Renderer = {
124
+ name: "table",
125
+ async render(doc: ProfileDocument): Promise<RenderResult> {
126
+ const env = doc.environment
127
+ ? [formatEnvironmentLine(doc.environment), ""]
128
+ : [];
129
+
130
+ // Only `ab()` writes paired measurements, and it always stamps `ab`.
131
+ if (doc.ab) return finish(renderPaired(doc, doc.ab, env));
132
+
133
+ const runs = timingRuns(doc);
134
+ const empty = noSampleRuns(doc);
135
+ const comparisons = renderComparisons(doc);
136
+ if (
137
+ runs.length === 0 &&
138
+ empty.length === 0 &&
139
+ skippedWorkloads(doc, runs).length === 0
140
+ ) {
141
+ return comparisons.length > 0
142
+ ? finish([...env, ...comparisons])
143
+ : { text: "(no timing runs)\n" };
144
+ }
145
+
146
+ const lines = [...env, ...renderTiming(doc, runs, empty)];
147
+ const instrumented = renderInstrumentedRuns(doc);
148
+ if (instrumented.length > 0) lines.push("", ...instrumented);
149
+ if (comparisons.length > 0) lines.push("", ...comparisons);
150
+ return finish(lines);
151
+ },
152
+ };
153
+
154
+ function renderTiming(
155
+ doc: ProfileDocument,
156
+ runs: ReturnType<typeof timingRuns>,
157
+ noSamples: ReturnType<typeof noSampleRuns>,
158
+ ): string[] {
159
+ const memory = memoryReadings(doc);
160
+ const runByWorkloadId = new Map(runs.map((r) => [r.workloadId, r]));
161
+ const noSampleByWorkloadId = new Map(noSamples.map((r) => [r.workloadId, r]));
162
+
163
+ // doc.workloads order, so a skipped task prints in its group's place.
164
+ const rows: TableRow<TimingRow>[] = [];
165
+ const measured: TimingRow[] = [];
166
+ for (const workload of doc.workloads) {
167
+ const run = runByWorkloadId.get(workload.id);
168
+ const label = workloadLabel(workload);
169
+ const group = groupOf(workload);
170
+ if (run) {
171
+ const data = { run, workload };
172
+ measured.push(data);
173
+ rows.push({ label, group, data, warnings: runWarnings(run, memory) });
174
+ } else if (noSampleByWorkloadId.has(workload.id)) {
175
+ const warnings = runWarnings(
176
+ noSampleByWorkloadId.get(workload.id)!,
177
+ memory,
178
+ );
179
+ rows.push({ label, group, status: "no samples", warnings });
180
+ } else if (workload.skipped) {
181
+ rows.push({ label, group, status: "skipped", warnings: [] });
182
+ }
183
+ }
184
+
185
+ const unitOf = ({ run }: TimingRow) => pickDurationUnit(run.timing.median);
186
+ const cpuTimesByRow = new Map(
187
+ measured.map((row) => [row, cpuTimes(row.run)]),
188
+ );
189
+ const ratios = relativeRatios(measured);
190
+
191
+ const columns: Column<TimingRow>[] = [
192
+ {
193
+ header: "Median",
194
+ width: 10,
195
+ cell: (row) => formatDuration(row.run.timing.median, unitOf(row)),
196
+ },
197
+ {
198
+ header: "Spread",
199
+ width: 18,
200
+ cell: (row) =>
201
+ formatSpan(row.run.timing.p75, row.run.timing.p99, unitOf(row)),
202
+ },
203
+ {
204
+ header: "Range",
205
+ width: 18,
206
+ cell: (row) =>
207
+ formatSpan(row.run.timing.min, row.run.timing.max, unitOf(row)),
208
+ },
209
+ ];
210
+ if ([...cpuTimesByRow.values()].some(Boolean)) {
211
+ columns.push({
212
+ header: "User/Sys",
213
+ width: 18,
214
+ cell: (row) => {
215
+ const times = cpuTimesByRow.get(row);
216
+ return times ? formatCpuTimes(times) : "";
217
+ },
218
+ });
219
+ }
220
+ if (measured.some((row) => row.run.instructions)) {
221
+ columns.push({
222
+ header: "Instr/call",
223
+ width: 10,
224
+ cell: (row) =>
225
+ row.run.instructions
226
+ ? formatInstructions(row.run.instructions.median)
227
+ : "",
228
+ });
229
+ }
230
+ for (const col of memoryColumns(memory)) {
231
+ columns.push({
232
+ header: col.header,
233
+ width: Math.max(col.header.length, MIN_MEMORY_WIDTH),
234
+ cell: (row) => col.cell(row.run.workloadId) ?? "",
235
+ });
236
+ }
237
+ if (ratios) {
238
+ columns.push({
239
+ header: "Relative",
240
+ width: 8,
241
+ cell: (row) => formatRelative(ratios.get(row)!, !!row.workload?.baseline),
242
+ });
243
+ }
244
+
245
+ return [...textTable(columns, rows), ...warningFootnotes(rows)];
246
+ }
247
+
248
+ function renderPaired(
249
+ doc: ProfileDocument,
250
+ ab: AbSummary,
251
+ env: string[],
252
+ ): string[] {
253
+ const byWorkload = workloadsById(doc);
254
+ const lines = [...env, `A/B: ${formatAbHeader(ab)}`, ""];
255
+
256
+ const threw: { label: string; verdict: string; message: string }[] = [];
257
+ const rows: TableRow<ReturnType<typeof pairedCells>>[] = abRows(doc).map(
258
+ ({ kind, run }) => {
259
+ const workload = byWorkload.get(run.workloadId);
260
+ const label = labelOrId(workload, run.workloadId);
261
+ let data: ReturnType<typeof pairedCells>;
262
+ if (kind === "threw") {
263
+ const verdict = formatThrew(run.threw);
264
+ threw.push({ label, verdict, message: run.threw.message });
265
+ data = {
266
+ base: "-",
267
+ candidate: "-",
268
+ change: "",
269
+ spread: "",
270
+ also: "",
271
+ verdict,
272
+ };
273
+ } else {
274
+ data = pairedCells(run, ab.metric);
275
+ }
276
+ return { label, group: groupOf(workload), data, warnings: run.warnings };
277
+ },
278
+ );
279
+ if (rows.length > 0) {
280
+ const also = alsoHeader(doc, ab.metric);
281
+ lines.push(
282
+ ...textTable<ReturnType<typeof pairedCells>>(
283
+ [
284
+ { header: "Base", width: 10, cell: (c) => c.base },
285
+ { header: "Candidate", width: 10, cell: (c) => c.candidate },
286
+ { header: "Change", width: 9, cell: (c) => c.change },
287
+ { header: "p25…p75", width: 18, cell: (c) => c.spread },
288
+ ...(also
289
+ ? [
290
+ {
291
+ header: also,
292
+ width: 8,
293
+ cell: (c: ReturnType<typeof pairedCells>) => c.also,
294
+ },
295
+ ]
296
+ : []),
297
+ { header: "Verdict", width: 7, cell: (c) => c.verdict },
298
+ ],
299
+ rows,
300
+ ),
301
+ );
302
+ }
303
+
304
+ const memory = memoryRows(doc);
305
+ if (memory.length > 0) {
306
+ lines.push(
307
+ "",
308
+ "Memory:",
309
+ ...textTable<ReturnType<typeof memoryCells>>(
310
+ [
311
+ { header: "Reading", width: 11, cell: (c) => c.reading },
312
+ { header: "Base", width: 10, cell: (c) => c.base },
313
+ { header: "Candidate", width: 10, cell: (c) => c.candidate },
314
+ { header: "Change", width: 18, cell: (c) => c.change },
315
+ { header: "Verdict", width: 7, cell: (c) => c.verdict },
316
+ ],
317
+ memory.map((row) => {
318
+ const workload = byWorkload.get(row.run.workloadId);
319
+ return {
320
+ label: labelOrId(workload, row.run.workloadId),
321
+ group: groupOf(workload),
322
+ data: memoryCells(row),
323
+ warnings: [],
324
+ };
325
+ }),
326
+ ),
327
+ );
328
+ }
329
+
330
+ const notes = abNotes(doc);
331
+ if (threw.length > 0) {
332
+ lines.push("", `Threw (${threw.length}):`);
333
+ for (const row of threw) {
334
+ const [first, ...rest] = row.message.split("\n");
335
+ lines.push(` ${row.label}: ${row.verdict}: ${first}`);
336
+ for (const more of rest) lines.push(` ${more}`);
337
+ }
338
+ }
339
+ if (notes.outputDiffers.length > 0) {
340
+ lines.push(
341
+ "",
342
+ `Output differs from the base (${notes.outputDiffers.length}):`,
343
+ ...notes.outputDiffers.map((label) => ` ${label}`),
344
+ );
345
+ }
346
+ const newSuites = formatNewSuites(ab);
347
+ if (newSuites) lines.push("", newSuites);
348
+ if (notes.baseOnly.length > 0 || notes.candOnly.length > 0) {
349
+ lines.push("", "Unmatched:");
350
+ if (notes.baseOnly.length > 0)
351
+ lines.push(` base only: ${notes.baseOnly.join(", ")}`);
352
+ if (notes.candOnly.length > 0)
353
+ lines.push(` candidate only: ${notes.candOnly.join(", ")}`);
354
+ }
355
+
356
+ lines.push(...warningFootnotes(rows), "", formatAbSummary(ab));
357
+ return lines;
358
+ }
359
+
360
+ function renderComparisons(doc: ProfileDocument): string[] {
361
+ const rows = comparedRows(doc);
362
+ if (rows.length === 0) return [];
363
+ const lines: string[] = [];
364
+
365
+ const mismatch = environmentMismatch(doc);
366
+ if (mismatch) lines.push(`⚠ ${mismatch.message}`, "");
367
+ const note = thresholdNote(doc);
368
+ if (note) lines.push(note, "");
369
+
370
+ const footnotes: string[] = [];
371
+ const notCompared: string[] = [];
372
+
373
+ for (const { row, cmp } of rows) {
374
+ if (row.verdict === "missing-base" || row.verdict === "missing-cand") {
375
+ notCompared.push(` ${row.task}: ${oneSidedNote(row.verdict)}`);
376
+ continue;
377
+ }
378
+ lines.push(`${row.pass === false ? "✗" : "✓"} ${row.task}`);
379
+ if (row.renamedFrom) lines.push(` renamed from ${row.renamedFrom.task}`);
380
+
381
+ if (row.timing) {
382
+ const { baseMedian, candMedian, medianDeltaPct, ci95, pValue } =
383
+ row.timing;
384
+ const unit = pickDurationUnit(Math.max(baseMedian, candMedian));
385
+ const medians = `${formatDuration(baseMedian, unit)} -> ${formatDuration(candMedian, unit)}`;
386
+ if (ci95 && pValue !== undefined) {
387
+ const p = pValue < 0.001 ? "p<0.001" : `p=${pValue.toFixed(3)}`;
388
+ lines.push(
389
+ ` timing: ${medians}, ${formatSignedPct(medianDeltaPct)} median, 95% CI [${formatSignedPct(ci95[0])}, ${formatSignedPct(ci95[1])}], ${p} (${row.verdict})`,
390
+ );
391
+ } else {
392
+ lines.push(
393
+ ` timing: ${medians}, ${formatSignedPct(medianDeltaPct)} median (${row.verdict})`,
394
+ );
395
+ }
396
+ }
397
+ const memory = shownMemoryDeltas(row, "->");
398
+ if (memory.length > 0) lines.push(` memory: ${memory.join(", ")}`);
399
+ if (!cmp) continue;
400
+ for (const f of shownFrameDeltas(cmp, TOP_FRAMES)) {
401
+ lines.push(
402
+ ` frame ${f.name}: ${formatSignedPct(f.deltaPct)} self-time (${formatUsAsMs(f.baseSelfUs)}ms -> ${formatUsAsMs(f.candSelfUs)}ms)`,
403
+ );
404
+ }
405
+ for (const h of shownHeapDeltas(cmp, TOP_TYPES)) {
406
+ lines.push(
407
+ ` heap ${h.type}: ${formatSignedPct(h.deltaPct)} count (${h.baseCount} -> ${h.candCount})`,
408
+ );
409
+ }
410
+
411
+ const warnings = rowComparisonWarnings(cmp);
412
+ if (warnings.length > 0) {
413
+ lines.push(` ! ${warnings.map((w) => w.code).join(", ")}`);
414
+ for (const w of warnings) footnotes.push(` ${row.task}: ${w.message}`);
415
+ }
416
+ }
417
+
418
+ if (notCompared.length > 0) lines.push("", "Not compared:", ...notCompared);
419
+ if (footnotes.length > 0)
420
+ lines.push("", "Comparison warnings:", ...footnotes);
421
+ return lines;
422
+ }
423
+
424
+ function renderInstrumentedRuns(doc: ProfileDocument): string[] {
425
+ const byWorkload: Map<string, Workload> = workloadsById(doc);
426
+ const lines: string[] = [];
427
+
428
+ for (const run of doc.measurements) {
429
+ if (run.phase !== "cpu" && run.phase !== "heap") continue;
430
+ const workload = byWorkload.get(run.workloadId);
431
+ const label = labelOrId(workload, run.workloadId);
432
+
433
+ if (run.phase === "cpu") {
434
+ if (run.cpu) {
435
+ lines.push(
436
+ `CPU capture - ${label} (instrumented, ${run.cpu.samplingIntervalUs}µs interval, ${cpuSampleCount(run.cpu)} samples, diagnostic wall ${formatNsAsMs(run.diagnosticWallNs ?? 0)}ms)`,
437
+ );
438
+ for (const f of topSelfFrames(run.cpu, TOP_FRAMES)) {
439
+ lines.push(
440
+ ` ${f.pct.padStart(5)}% ${formatUsAsMs(f.selfUs).padStart(8)}ms self ${f.frame?.name ?? "?"}`,
441
+ );
442
+ }
443
+ } else {
444
+ lines.push(
445
+ `CPU capture - ${label} (instrumented, no evidence captured)`,
446
+ );
447
+ }
448
+ } else if (run.heap) {
449
+ lines.push(
450
+ `Heap snapshot - ${label} (instrumented, ${formatHeapSummary(run.heap)})`,
451
+ );
452
+ for (const tc of run.heap.typeCounts.slice(0, TOP_TYPES)) {
453
+ lines.push(` ${String(tc.count).padStart(6)} ${tc.type}`);
454
+ }
455
+ } else {
456
+ lines.push(
457
+ `Heap snapshot - ${label} (instrumented, no evidence captured)`,
458
+ );
459
+ }
460
+
461
+ for (const a of run.artifacts) lines.push(` artifact: ${a.path}`);
462
+ for (const w of run.warnings) lines.push(` ! ${w.message}`);
463
+ }
464
+
465
+ return lines;
466
+ }
@@ -0,0 +1,27 @@
1
+ import type { ProfileDocument } from "../ir/types.ts";
2
+
3
+ export type FormatName =
4
+ | "table"
5
+ | "json"
6
+ | "markdown"
7
+ | "jsonl"
8
+ | "minimal"
9
+ | "collapsed"
10
+ | "mermaid"
11
+ | "speedscope"
12
+ | "cpuprofile";
13
+
14
+ export interface VizOptions {
15
+ /** Render this measurement only, instead of every CPU measurement. */
16
+ measurementId?: string;
17
+ }
18
+
19
+ export interface RenderResult {
20
+ text?: string;
21
+ files?: { path?: string; content: string }[];
22
+ }
23
+
24
+ export interface Renderer<O = unknown> {
25
+ name: FormatName;
26
+ render(doc: ProfileDocument, options: O): Promise<RenderResult>;
27
+ }