Rust async is built around task scheduling—tasks are the language-level unit the executor moves between.
Can you see that scheduling happen? Yes. Tokio ships tokio-console: a live view of tasks, polls, and wakeups that helps when you’re debugging latency or learning how the runtime behaves.
Setup
Your program reports events through console-subscriber; the tokio-console CLI aggregates and displays them.
The API is still unstable, so you need a few flags.
Enable Tokio’s tracing feature and add the subscriber, e.g.:
1 | [dependencies] |
Initialize in main:
1 |
|
Run with: RUSTFLAGS="--cfg tokio_unstable" cargo run
Or bake it into .cargo/config.toml:
1 | [build] |
Install the viewer with cargo install tokio-console, then run your app and attach the console.
Instrumenting the demo
The demo reuses the two-thread alternating-print Semaphore pattern; tracing hooks are marked in comments:
1 | use std::{sync::Arc, time::Duration}; |
What you see
Switch between task view (t) and resource view (r).
Tasks
Per task you get time buckets (Total, Busy, Sched, Idle), poll counts, and state.
For what those timers mean, see task-scheduled-time-in-console.

Arrow keys move the selection; Enter drills into a row (e.g. task-t2) for waker details and finer-grained timing—handy for spotting stragglers.

Resources
The resource view lists which async primitives were exercised.

Expand a row for per-call timing—for example the three semaphore_wait.acquire calls on t2.

Full sample: tokio-play
More examples: console-subscriber/examples
Questions? Leave a comment below or email: newbvirgil@gmail.com![]()
