As developers, we're always looking for ways to gain deeper insights into our applications' runtime behavior. That's why we're excited to announce the initial release of Tokio Console (Github), a diagnostics and debugging tool specifically designed for asynchronous Rust programs.
Tokio Console provides a live, easy-to-navigate view into the program's tasks and resources, summarizing both their current status and historical behavior. Gone are the days of interpreting event logs or struggling to understand tracing events – with Tokio Console, you can gain valuable insights without writing any new instrumentation logic.
What is Tokio Console?
Tokio Console is a game-changer for async Rust developers. By providing a presentation of the async runtime in terms already familiar to the developer (tasks being polled and resources acquired or released), it simplifies the debugging process. Just one line of code enables Tokio Console, and you can start observing your app's runtime behavior with ease.
Features and Benefits
Tokio Console offers a range of features that make debugging async Rust applications a breeze:
- Task visualization: See tasks being polled by the async runtime, along with their current status and historical behavior.
- Resource monitoring: Track resources such as async mutexes and semaphores, including which tasks have entered critical sections or are waiting to obtain access.
- Warning system: Identify potential issues, such as tasks that have run for a very long time without yielding or woken themselves more times than they've been woken by other tasks.
Getting Started
To start using Tokio Console, simply install the console-subscriber crate and add one line of code to your async application. Then, run tokio-console in a terminal to connect to your app and start observing its runtime behavior.
Roadmap
This is just the beginning for Tokio Console. We have many exciting features planned, including:
- More instrumentation: Adding more instrumentation to Tokio and other ecosystem libraries.
- Improved warning system: Adding searchable online documentation describing various warnings and how they can be solved.
- New visualizations: Introducing new visualizations, such as a tree of tasks and their parents or a timeline of the program's execution.
To make this happen, we need your feedback. Share your experiences with Tokio Console, and help us build the future of runtime diagnostics for Rust. Join the #console channel on Discord to stay up-to-date with our progress and provide input on how we can improve.
Acknowledgments
We'd like to thank the following individuals for their contributions:
- Sean McArthur
- Zahari Dichev
- @gnieto
- Felix S Klock II
- Gus Wynn
- Oğuz Bilgener
- @memoryruins
- Luna Razzaghipour
- @daladim
- @hatoo
- Adam Gleave
- Jacob Rothstein
- David Barsky
- @Milo123459
- Wu Aoxiang
- Yusuf Bera Ertan
- @battlmonstr
- Artem Vorotnikov