Skip to content

feat(engine): expose ReorderBuffer stall-duration and queue-depth metrics (#1885)#4195

Merged
oferchen merged 1 commit into
masterfrom
feat/reorderbuffer-stall-metrics-1885
May 17, 2026
Merged

feat(engine): expose ReorderBuffer stall-duration and queue-depth metrics (#1885)#4195
oferchen merged 1 commit into
masterfrom
feat/reorderbuffer-stall-metrics-1885

Conversation

@oferchen
Copy link
Copy Markdown
Owner

Summary

  • Adds ReorderBuffer::metrics() returning a Metrics { stall_duration, current_depth, max_depth } snapshot so operators can diagnose pipeline stalls without ad hoc instrumentation. Feeds the spill-to-tempfile diagnostics tracked in Ensure release workflow uploads architecture-specific assets #1884.
  • Instant::now is sampled only on stall edges (gap opens, gap closes); steady-state in-order inserts pay no extra syscall.
  • Max-depth and stall counters are reused across insert, next_in_order, force_insert, and take. Bypass / passthrough mode reports depth only since it does not reorder.
  • Re-exports the new type as ReorderMetrics from engine::concurrent_delta alongside the existing ReorderBuffer re-export.

Test plan

  • command cargo fmt --all -- --check
  • command cargo clippy -p engine --all-features --all-targets --no-deps -- -D warnings
  • command cargo nextest run -p engine --all-features -E 'test(concurrent_delta::reorder)' (68 tests, including the 9 new metrics_tests cases)

Closes #1885

Adds a public `Metrics` snapshot returned by `ReorderBuffer::metrics()`
exposing the cumulative stall duration (time spent waiting for the next
expected sequence while items are buffered ahead), the instantaneous
queue depth, and the high-water mark since construction. `Instant::now`
is only sampled on stall edges, keeping the hot path allocation- and
syscall-free for in-order inserts. Bypass mode reports depth only, since
it never reorders. Includes unit tests covering single and multi-stall
windows, force_insert / take interactions, and the in-flight snapshot
behaviour. Closes #1885.
@github-actions github-actions Bot added the enhancement New feature or request label May 17, 2026
@oferchen oferchen merged commit b11ed69 into master May 17, 2026
39 checks passed
@oferchen oferchen deleted the feat/reorderbuffer-stall-metrics-1885 branch May 17, 2026 03:24
oferchen added a commit that referenced this pull request May 18, 2026
Adds a public `Metrics` snapshot returned by `ReorderBuffer::metrics()`
exposing the cumulative stall duration (time spent waiting for the next
expected sequence while items are buffered ahead), the instantaneous
queue depth, and the high-water mark since construction. `Instant::now`
is only sampled on stall edges, keeping the hot path allocation- and
syscall-free for in-order inserts. Bypass mode reports depth only, since
it never reorders. Includes unit tests covering single and multi-stall
windows, force_insert / take interactions, and the in-flight snapshot
behaviour. Closes #1885.
oferchen added a commit that referenced this pull request May 18, 2026
Adds a public `Metrics` snapshot returned by `ReorderBuffer::metrics()`
exposing the cumulative stall duration (time spent waiting for the next
expected sequence while items are buffered ahead), the instantaneous
queue depth, and the high-water mark since construction. `Instant::now`
is only sampled on stall edges, keeping the hot path allocation- and
syscall-free for in-order inserts. Bypass mode reports depth only, since
it never reorders. Includes unit tests covering single and multi-stall
windows, force_insert / take interactions, and the in-flight snapshot
behaviour. Closes #1885.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant