Skip to content

Add pipeline stats and benchmark flags - #18

Merged
alexchuber merged 4 commits into
mainfrom
pipeline-run-metrics
Sep 17, 2026
Merged

alexchuber merged 4 commits into
mainfrom
pipeline-run-metrics

Conversation

@alexchuber

@alexchuber alexchuber commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add independent, opt-in --stats and --benchmark flags to the pipeline CLI.
  • --stats prints total size before and after for the named input and output files, using one unit selected from the total size before.
  • --benchmark prints completion time, user/system CPU time, RSS, process-lifetime peak RSS, and heap used. Completion time selects one shared unit for all timing rows: ms, s, min, or h.
  • Size units use B, KiB, MiB, GiB, TiB, or PiB. Memory values scale independently. Bytes remain whole numbers; other sizes and all times use two decimal places. Reference values that round to a unit boundary promote to the next unit.
  • Keep the existing output when neither flag is supplied, and print reports only after a successful write and disposal.
  • Update command help and usage guides; cover individual/combined flags, size growth/shrinkage across unit boundaries, timing boundaries, shared-unit consistency, benchmark values, default silence, and failed writes through the built CLI.

Measurement scope

Size statistics cover the named files, not external buffers/images referenced by glTF. Timing covers pipeline creation (including library loading), execution, output writing, and disposal. RSS and heap are process-wide completion snapshots; peak RSS is explicitly labeled as the process-lifetime high-water mark. Size totals retain the unit chosen from the input size, and CPU times retain the unit chosen from completion time, even when the other values would independently select different units.

Validation

  • Initial CLI flag implementation: pnpm test tests/e2e/cli.test.ts — 43 passed.
  • Shared-unit follow-up: targeted CLI report, formatting, help, round-trip, and failed-write coverage — 32 passed. Deterministic child-process clocks cover zero durations, seconds/minutes/hours, rounding boundaries, and CPU times crossing the reference unit's boundary without waiting for long runs.
  • pnpm exec eslint packages/cli/src/cli.ts packages/cli/src/benchmark.ts packages/cli/src/format.ts tests/e2e/cli.test.ts
  • pnpm typecheck
  • pnpm build
  • pnpm --filter @babylonjs/node-assets-cli build

alexchuber and others added 3 commits September 17, 2026 05:30
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

@RaananW RaananW left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 This review comment was created by an AI agent.

Thank you for the clear implementation and thorough CLI coverage. The new reports are opt-in, run only after a successful write and disposal, and keep the existing output unchanged by default. I found no blocking correctness, lifecycle, bloat, reuse, or CI security issue. CI covers lint, type-checking, tests, and builds, and is green.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@alexchuber
alexchuber merged commit 8ee51a4 into main Sep 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants