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

Format "last woken" time prettily #524

Closed
hds opened this issue Feb 14, 2024 · 4 comments · Fixed by #529
Closed

Format "last woken" time prettily #524

hds opened this issue Feb 14, 2024 · 4 comments · Fixed by #529
Labels
C-console Crate: console. E-easy Effort: easy. Good for newcomers S-bug Severity: bug

Comments

@hds
Copy link
Collaborator

hds commented Feb 14, 2024

What crate(s) in this repo are involved in the problem?

tokio-console

What is the issue?

Tokio console has nice prettily formatted times when UTF-8 support is turned on.

The times use only a small number of decimal places and are colour coded depending on the multiplier (seconds, milliseconds, etc.).

However, in the Task detail screen in the Waker panel, there is a time for "last woken" which does not have this formatting. It is not color-coded and it generally displays far too many decimal places.

How can the bug be reproduced?

Enter the task detail screen for a task that has been woken at least once. Look at the Waker panel, specifically the "last woken" value.

See screenshot for details and a comparison of the pretty vs. non-pretty times:

tokio-console-last_woken_time

Logs, error output, etc

No response

Versions

tokio-console: 0.1.10 (and also the main branch at the time of writing).

Possible solution

Change the formatting of the value for "last woken":

wakeups.push(Span::from(format!(" {:?} ago", since)));

See the value for the "total time" field in the Task panel for an example of how to format the time prettily:

styles.time_units(total, view::DUR_LIST_PRECISION, None),

@hds hds added S-bug Severity: bug E-easy Effort: easy. Good for newcomers C-console Crate: console. labels Feb 14, 2024
@devanbenz
Copy link
Contributor

I can take this one on

@hds hds assigned devanbenz and unassigned devanbenz Feb 14, 2024
@hds
Copy link
Collaborator Author

hds commented Feb 14, 2024

Unassigned @devanbenz, that was a mistake.

@yerke
Copy link
Contributor

yerke commented Feb 24, 2024

Hi @hds. I created #529 to address this. Do you mind taking a look?

@hds
Copy link
Collaborator Author

hds commented Feb 24, 2024

Hi @hds. I created #529 to address this. Do you mind taking a look?

@yerke Yes,looks good, It might not get merged until Monday though.

yerke added a commit to yerke/console that referenced this issue Feb 25, 2024
Use consistent pretty format for 'last woken' time in task view.

Closes tokio-rs#524
yerke added a commit to yerke/console that referenced this issue Feb 27, 2024
Use consistent pretty format for 'last woken' time in task view.

Closes tokio-rs#524
@hds hds closed this as completed in #529 Feb 27, 2024
hds pushed a commit that referenced this issue Feb 27, 2024
Use consistent pretty format for 'last woken' time in task view.

This is the same pretty format that is used for all the other durations
across the Tokio Console UI.

Closes: #524
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-console Crate: console. E-easy Effort: easy. Good for newcomers S-bug Severity: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants