From ea11ad8d6040ef564952b80d58abc713376b6160 Mon Sep 17 00:00:00 2001 From: Yerkebulan Tulibergenov Date: Tue, 27 Feb 2024 00:18:54 -0800 Subject: [PATCH] fix(console): add pretty format for 'last woken' time (#529) 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 --- tokio-console/src/view/task.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tokio-console/src/view/task.rs b/tokio-console/src/view/task.rs index 8f3024520..8a6494464 100644 --- a/tokio-console/src/view/task.rs +++ b/tokio-console/src/view/task.rs @@ -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));