Skip to content
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

Merged
merged 4 commits into from Sep 22, 2021
Merged

Conversation

zaharidichev
Copy link
Collaborator

@zaharidichev zaharidichev commented Sep 22, 2021

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

Screenshot 2021-09-22 at 22 56 50

Signed-off-by: Zahari Dichev zaharidichev@gmail.com

Copy link
Member

@hawkw hawkw left a 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?

Comment on lines 150 to 151
// 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);
Copy link
Member

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);

Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Signed-off-by: Zahari Dichev <zaharidichev@gmail.com>
Copy link
Member

@hawkw hawkw left a comment

Choose a reason for hiding this comment

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

wonderful!

Comment on lines +421 to +423
Self::Target => {
tasks.sort_unstable_by_key(|task| task.upgrade().map(|t| t.borrow().target.clone()))
}
Copy link
Member

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!

@hawkw hawkw merged commit e0c4789 into main Sep 22, 2021
@hawkw hawkw deleted the zd/show-location-as-column branch September 22, 2021 20:36
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.

None yet

2 participants