Skip to content

Commit

Permalink
fix(console): add pretty format for 'last woken' time (#529)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yerke authored Feb 27, 2024
1 parent bdaf05e commit ea11ad8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tokio-console/src/view/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,9 @@ impl TaskView {
if let Some(since) = task.since_wake(now) {
wakeups.reserve(3);
wakeups.push(Span::raw(", "));
wakeups.push(bold("last woken:"));
wakeups.push(Span::from(format!(" {:?} ago", since)));
wakeups.push(bold("last woken: "));
wakeups.push(styles.time_units(since, view::DUR_LIST_PRECISION, None));
wakeups.push(Span::raw(" ago"));
}

waker_stats.push(Spans::from(wakeups));
Expand Down

0 comments on commit ea11ad8

Please sign in to comment.