-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
add metrics counter for finished spawned tasks #4481
Conversation
Codecov Report
... and 26 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
if you want to get extra fancy you can do something like
struct IncCounterOnDrop(Counter)
impl Drop for IncCounterOnDrop {
fn drop(&self) {
// incr
}
}
this would also solve the issue that on panic the counter wouldn't get decreased atm
so wrap the relevant counter in the helper type and move into the task closure
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 works, thanks
Closes #4479
I add two fields to
TaskExecutorMetrics
:finished_critical_tasks
finished_regular_tasks
And then updates the
spawn
andspawn_critical
functions in order to properly increase finished critical and regular tasks metrics as well.