feat: log per-command processing time (MK-1) #20

Merged
David merged 1 commit from feat/per-command-timing into main 2026-05-18 02:55:31 +02:00
Owner

Summary

Emits a wall-clock duration for every monkey subcommand so users can compare filter cost, spot pathologically slow inputs, and feed capacity planning. No new dependencies, just std::time::Instant.

  • monkey image <verb>: trailing success line gains a (1.23s) suffix. Entry header removed since timing is only known at the end. Covers run_filter and the special-case Colors/Density/Diff arms.
  • monkey noteshrink: per-phase elapsed (palette / apply / save) plus a final noteshrink: <total> line. --quiet continues to suppress everything.
  • monkey pdf extract-images: trailing summary line gains a (1.23s) suffix.
  • monkey video convert: left alone; ffmpeg already reports its own timing.

Duration formatter: sub-second prints as Nms, longer as N.NNs.

#MK-1

Test plan

  • just check (fmt, clippy, build, tests, docker compile check)
  • Manual smoke: monkey image local-contrast prints local-contrast: in -> out (0ms)
  • Manual smoke: monkey noteshrink prints all four lines; --quiet prints nothing
  • Manual smoke: monkey pdf extract-images against a real PDF
## Summary Emits a wall-clock duration for every monkey subcommand so users can compare filter cost, spot pathologically slow inputs, and feed capacity planning. No new dependencies, just `std::time::Instant`. - `monkey image <verb>`: trailing success line gains a `(1.23s)` suffix. Entry header removed since timing is only known at the end. Covers `run_filter` and the special-case `Colors`/`Density`/`Diff` arms. - `monkey noteshrink`: per-phase elapsed (`palette` / `apply` / `save`) plus a final `noteshrink: <total>` line. `--quiet` continues to suppress everything. - `monkey pdf extract-images`: trailing summary line gains a `(1.23s)` suffix. - `monkey video convert`: left alone; ffmpeg already reports its own timing. Duration formatter: sub-second prints as `Nms`, longer as `N.NNs`. #MK-1 ## Test plan - [x] `just check` (fmt, clippy, build, tests, docker compile check) - [x] Manual smoke: `monkey image local-contrast` prints `local-contrast: in -> out (0ms)` - [x] Manual smoke: `monkey noteshrink` prints all four lines; `--quiet` prints nothing - [ ] Manual smoke: `monkey pdf extract-images` against a real PDF
feat: log per-command processing time
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 41s
Create release / Create release from merged PR (pull_request) Has been skipped
255935d4f7
Wrap each image, noteshrink, and pdf subcommand with std::time::Instant and append the elapsed duration to its success line. Sub-second durations format as ms, longer ones as N.NNs.

For image filters the trailing line replaces the entry header so each command emits exactly one summary line including timing. noteshrink prints per-phase (palette/apply/save) elapsed plus a total. --quiet still suppresses everything. pdf extract-images appends the duration to its existing trailing summary. video::convert is left alone since ffmpeg prints its own timing.

#MK-1 State Done
David merged commit 2cb777a824 into main 2026-05-18 02:55:31 +02:00
David deleted branch feat/per-command-timing 2026-05-18 02:55:31 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pandoras-box/monkey!20
No description provided.