Add partition loop arm duration metric#5096
Conversation
Measure partition loop arm durations This fixes restatedev#5067.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1cb8dc9508
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| // Add this timer inside select arms that can block while handling ready work, such as on | ||
| // RocksDB reads or writes and other awaits. Do not time the select wait itself. | ||
| let loop_duration = histogram!(PARTITION_PROCESSOR_LOOP_DURATION_SECONDS); |
There was a problem hiding this comment.
Time the leader-query loop arm
When an introspection query requests scheduler status or user-limit counters, this uninstrumented arm executes synchronous full scans: read_scheduler_status iterates every tracked vqueue and collects a Vec, while read_user_limit_counters walks the counter trie (crates/worker/src/partition/leadership/leader_state.rs:172-190). On partitions with many queues or counters, that work can delay the processor loop, but the new histogram records nothing, hiding exactly this class of loop-arm stall. Add a HistogramTimer to the leader_query_rx arm as well.
AGENTS.md reference: AGENTS.md:L81-L81
Useful? React with 👍 / 👎.
Measure partition loop arm durations
This fixes #5067.