EMRY-012: Throughput + ETA processor #57

Merged
vxfemboy merged 2 commits from emry-012-throughput-eta into main 2026-06-25 02:46:07 +00:00
vxfemboy commented 2026-06-25 02:41:07 +00:00 (Migrated from github.com)

Closes EMRY-012 (#10). Branched off main.

What

crates/emry-engine/src/throughput.rsThroughput Processor reporting:

  • steps_per_sec — over a sliding window of (time, step) samples
  • eta_secs — when total_steps is known (set_total_steps updates it mid-run)

Events carry no wall-clock time, so the live on_event path stamps a monotonic Instant; the rate math is a pure observe(step, now_secs) for deterministic tests. Ignores non-advancing/out-of-order steps and zero-duration windows.

Verification

  • ./scripts/pre-commit-rust.sh green: clippy -D warnings, 23 engine tests, throughput.rs 100% lines, total 95.01%
  • Synthetic-timestamp tests: rate, ETA, no-total, window slide, eta-floor-at-total, set_total_steps

Review-driven changes

  • Added set_total_steps (review conf 80): extended runs no longer emit a misleading eta_secs=0.
  • Documented the time-origin hazard (review conf 87): observe/on_event must not be mixed on one instance.
  • Tightened the cast-precision comment and a misleading test comment.
Closes EMRY-012 (#10). Branched off `main`. ## What `crates/emry-engine/src/throughput.rs` — `Throughput` Processor reporting: - `steps_per_sec` — over a sliding window of `(time, step)` samples - `eta_secs` — when `total_steps` is known (`set_total_steps` updates it mid-run) Events carry no wall-clock time, so the live `on_event` path stamps a monotonic `Instant`; the rate math is a **pure** `observe(step, now_secs)` for deterministic tests. Ignores non-advancing/out-of-order steps and zero-duration windows. ## Verification - `./scripts/pre-commit-rust.sh` green: clippy `-D warnings`, 23 engine tests, throughput.rs 100% lines, total 95.01% - Synthetic-timestamp tests: rate, ETA, no-total, window slide, eta-floor-at-total, set_total_steps ## Review-driven changes - Added `set_total_steps` (review conf 80): extended runs no longer emit a misleading `eta_secs=0`. - Documented the time-origin hazard (review conf 87): `observe`/`on_event` must not be mixed on one instance. - Tightened the cast-precision comment and a misleading test comment.
Sign in to join this conversation.
No reviewers
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
femboy/emry!57
No description provided.