-
-
Notifications
You must be signed in to change notification settings - Fork 151
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
console: show spawn location as a column #166
Conversation
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
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.
overall, this looks good! i think we should probably also add support for sorting tasks by location, but it's up to you if you want to do that as part of this PR or in a follow-up?
console/src/view/task.rs
Outdated
// Just preallocate capacity for ID, name, target, total, busy, and idle. | ||
let mut metrics = Vec::with_capacity(6); | ||
metrics.push(Spans::from(vec![ | ||
let mut overview = Vec::with_capacity(6); |
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.
+1 for renaming this.
now that it also has a line for the location, we should probably update the with_capacity
call:
// Just preallocate capacity for ID, name, target, location, total, busy, and idle.
let mut overview = Vec::with_capacity(7);
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.
wonderful!
Self::Target => { | ||
tasks.sort_unstable_by_key(|task| task.upgrade().map(|t| t.borrow().target.clone())) | ||
} |
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.
👍 for adding this as well!
This PR extracts the spawn location of a task into a separate
column, in the case where structured location information is
present. This depends on: tokio-rs/tokio#4128
Signed-off-by: Zahari Dichev zaharidichev@gmail.com