ostia 0.4.0 → 0.6.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 (64) hide show
  1. package/README.md +31 -30
  2. package/docs/agent-protocol.md +13 -9
  3. package/docs/cli.md +174 -126
  4. package/docs/config.md +2 -2
  5. package/docs/document-schema.md +15 -12
  6. package/docs/library.md +32 -21
  7. package/docs/preload-recipes.md +4 -4
  8. package/docs/statistics.md +14 -13
  9. package/index.d.ts +202 -60
  10. package/package.json +1 -1
  11. package/src/ab/ab-runner.ts +6 -6
  12. package/src/ab/index.ts +56 -6
  13. package/src/ab/unpaired.ts +54 -0
  14. package/src/bench/index.ts +40 -3
  15. package/src/bench/registry.ts +6 -4
  16. package/src/bench/run-tasks.ts +16 -2
  17. package/src/bench/runner.ts +10 -3
  18. package/src/bench/support.ts +8 -4
  19. package/src/bench/sweep.ts +2 -2
  20. package/src/cache/fingerprint.ts +2 -2
  21. package/src/capture/bunflags.ts +2 -2
  22. package/src/capture/cpu.ts +2 -2
  23. package/src/capture/heap-parse.ts +2 -2
  24. package/src/ci/index.ts +39 -48
  25. package/src/cli/agent.ts +54 -0
  26. package/src/cli/flags.ts +58 -9
  27. package/src/cli/help.ts +670 -245
  28. package/src/cli/main.ts +2 -3
  29. package/src/cli/output.ts +17 -14
  30. package/src/cli/run.ts +317 -92
  31. package/src/compare/index.ts +4 -4
  32. package/src/config/index.ts +14 -10
  33. package/src/config/validate.ts +4 -4
  34. package/src/glob.ts +2 -2
  35. package/src/index.ts +3 -2
  36. package/src/ir/document.ts +2 -2
  37. package/src/ir/types.ts +49 -24
  38. package/src/measure/alloc.ts +2 -2
  39. package/src/measure/cpu.ts +2 -2
  40. package/src/measure/environment.ts +11 -6
  41. package/src/measure/inprocess.ts +14 -10
  42. package/src/measure/instructions.ts +2 -2
  43. package/src/measure/noise.ts +51 -13
  44. package/src/measure/paired.ts +2 -2
  45. package/src/measure/peak.ts +4 -4
  46. package/src/measure/timing.ts +27 -6
  47. package/src/profile.ts +6 -4
  48. package/src/renderers/collapsed.ts +2 -2
  49. package/src/renderers/concise.ts +148 -0
  50. package/src/renderers/format.ts +13 -4
  51. package/src/renderers/human.ts +402 -0
  52. package/src/renderers/index.ts +9 -2
  53. package/src/renderers/markdown.ts +2 -2
  54. package/src/renderers/mermaid.ts +2 -2
  55. package/src/renderers/minimal.ts +8 -7
  56. package/src/renderers/relative.ts +2 -2
  57. package/src/renderers/select.ts +2 -2
  58. package/src/renderers/terminal.ts +1178 -383
  59. package/src/renderers/types.ts +3 -0
  60. package/src/spawn/index.ts +47 -14
  61. package/src/stats/bootstrap.ts +2 -2
  62. package/src/stats/index.ts +2 -2
  63. package/src/terminal.ts +321 -0
  64. package/src/time.ts +124 -20
@@ -112,8 +112,8 @@ export interface MinimalRunLine {
112
112
  groupDescription?: string;
113
113
  params?: Record<string, string | number | boolean>;
114
114
  /**
115
- * `task.skip()` / `group.skip()`: no measurement, so every stats field is
116
- * absent.
115
+ * `task.skip()` / `group.skip()`: no measurement, so every stats field
116
+ * is absent.
117
117
  */
118
118
  skipped?: true;
119
119
  unit?: "ns";
@@ -207,8 +207,8 @@ export interface MinimalSummaryLine {
207
207
  /** `ab` only: the gate on `geomeanPct`. */
208
208
  geomeanThresholdPct?: number;
209
209
  /**
210
- * `ab` only: flagged in the first process but not reproduced; counted in
211
- * `unchanged`.
210
+ * `ab` only: flagged in the first process but not reproduced; counted
211
+ * in `unchanged`.
212
212
  */
213
213
  unconfirmed?: number;
214
214
  /**
@@ -239,8 +239,9 @@ export type MinimalEvent =
239
239
  /**
240
240
  * What the `unmatched`/`summary` events need beyond one `ProfileDocument`.
241
241
  * The CLI builds it for `compare`/`ci`/`ab`; without it `minimal` emits
242
- * only `run` lines. `exitCode` is inline because the CLI decides it after
243
- * rendering. */
242
+ * only `run` lines. `exitCode` is inline because the CLI decides it
243
+ * after rendering.
244
+ */
244
245
  export interface MinimalProtocolContext {
245
246
  command: "compare" | "ci" | "ab";
246
247
  exitCode: number;
@@ -584,7 +585,7 @@ function summaryLine(
584
585
  }
585
586
 
586
587
  export const minimalRenderer: Renderer<MinimalRenderOptions> = {
587
- name: "minimal",
588
+ name: "events",
588
589
  render(
589
590
  doc: ProfileDocument,
590
591
  options: MinimalRenderOptions = {},
@@ -7,8 +7,8 @@ export interface TimingRow {
7
7
  }
8
8
 
9
9
  // The explicit `entry.group` the bench runner records, else the
10
- // "group/name" id split on its last "/" (documents from before that field
11
- // existed).
10
+ // "group/name" id split on its last "/" (documents from before that
11
+ // field existed).
12
12
  export function groupOf(workload: Workload | undefined): string | undefined {
13
13
  if (!workload?.entry) return undefined;
14
14
  if (workload.entry.group !== undefined) return workload.entry.group;
@@ -224,8 +224,8 @@ function rebuildCompared(doc: ProfileDocument): ComparedTask[] {
224
224
  ];
225
225
  }
226
226
 
227
- // Heap readings move with GC timing, so a small change is noise, not a
228
- // line.
227
+ // Heap readings move with GC timing, so a small change is noise, not
228
+ // a line.
229
229
  const MIN_MEMORY_DISPLAY_PCT = 10;
230
230
 
231
231
  const MEMORY_READING_LABELS: Record<MemoryDelta["reading"], string> = {