Skip to content

Add partition loop arm duration metric#5096

Open
tillrohrmann wants to merge 1 commit into
restatedev:mainfrom
tillrohrmann:partition-loop-latency-metrics
Open

Add partition loop arm duration metric#5096
tillrohrmann wants to merge 1 commit into
restatedev:mainfrom
tillrohrmann:partition-loop-latency-metrics

Conversation

@tillrohrmann

Copy link
Copy Markdown
Contributor

Measure partition loop arm durations

This fixes #5067.

Measure partition loop arm durations

This fixes restatedev#5067.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@tillrohrmann
tillrohrmann removed the request for review from AhmedSoliman July 22, 2026 14:23
@tillrohrmann

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment on lines +517 to +519
// 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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

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.

Add more partition processor loop metrics to diagnose blocking operations

1 participant