-
Notifications
You must be signed in to change notification settings - Fork 111
[11/N][VQueues] Refine the definition of active vs. dormant vqueue #4066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,52 @@ | ||
| // Copyright (c) 2023 - 2025 Restate Software, Inc., Restate GmbH. | ||
| // All rights reserved. | ||
| // | ||
| // Use of this software is governed by the Business Source License | ||
| // included in the LICENSE file. | ||
| // | ||
| // As of the Change Date specified in that file, in accordance with | ||
| // the Business Source License, use of this software will be governed | ||
| // by the Apache License, Version 2.0. | ||
|
|
||
| use metrics::{Unit, counter, describe_counter}; | ||
|
|
||
| pub const VQUEUE_ENQUEUE: &str = "restate.vqueue.scheduler.enqueue.total"; | ||
| pub const VQUEUE_SCHEDULER_DECISION: &str = "restate.vqueue.scheduler.decision.total"; | ||
| pub const VQUEUE_RUN_CONFIRMED: &str = "restate.vqueue.scheduler.run_confirmed.total"; | ||
| pub const VQUEUE_RUN_REJECTED: &str = "restate.vqueue.scheduler.run_rejected.total"; | ||
|
|
||
| pub const ACTION_YIELD: &str = "yield"; | ||
| pub const ACTION_RESUME: &str = "resume"; | ||
| pub const ACTION_RUN: &str = "run"; | ||
|
|
||
| pub fn describe_metrics() { | ||
| describe_counter!( | ||
| VQUEUE_ENQUEUE, | ||
| Unit::Count, | ||
| "Number of entries/invocations in vqueues added to the waiting inbox" | ||
| ); | ||
|
|
||
| describe_counter!( | ||
| VQUEUE_SCHEDULER_DECISION, | ||
| Unit::Count, | ||
| "Number of entries in vqueues scheduler, broken down by decision" | ||
| ); | ||
|
|
||
| describe_counter!( | ||
| VQUEUE_RUN_CONFIRMED, | ||
| Unit::Count, | ||
| "Number of entries/invocations in vqueues where the run request was confirmed" | ||
| ); | ||
|
|
||
| describe_counter!( | ||
| VQUEUE_RUN_REJECTED, | ||
| Unit::Count, | ||
| "Number of entries/invocations in vqueues where the run request was rejected" | ||
| ); | ||
| } | ||
|
|
||
| pub fn publish_scheduler_decision_metrics(num_run: usize, num_yield: usize, num_resume: usize) { | ||
| counter!(VQUEUE_SCHEDULER_DECISION, "action" => ACTION_RUN).increment(num_run as u64); | ||
| counter!(VQUEUE_SCHEDULER_DECISION, "action" => ACTION_RESUME).increment(num_resume as u64); | ||
| counter!(VQUEUE_SCHEDULER_DECISION, "action" => ACTION_YIELD).increment(num_yield as u64); | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the situation in which we can call
attempt_to_runand the vqueue being dormant? Would it be a situation in which a user paused a vqueue and the scheduler was scheduling an invocation concurrently?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can happen if the vqueue has no waiting items and we decided to unpark an item by skipping the inbox stage for any reason. It's primarily for being defensive but it shouldn't happen with the current defined flows.