doc: add tokio-console page in book dev section (#4641)

* doc: add tokio-console page in dev section

* Add screenshot

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
This commit is contained in:
Deirdre Connolly 2022-06-20 23:38:12 -04:00 committed by GitHub
parent b6a59a9f66
commit 21af125bfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 38 additions and 0 deletions

View File

@ -0,0 +1,38 @@
# `tokio-console` support
`tokio-console` is a diagnostics and debugging tool for asynchronous Rust programs. This tool can be
useful to lint runtime behavior, collect diagnostic data from processes, and debugging performance
issues. ["it's like top(1) for tasks!"][top]
### Setup
Support for `tokio-console` is not enabled by default for zebrad. To activate this feature, run:
```sh
$ RUSTFLAGS="--cfg tokio_unstable" cargo build --no-default-features --features="tokio-console" --bin zebrad
```
Install [`tokio-console`][install].
Then start `zebrad` however you wish.
When `zebrad` is running, run:
```
$ tokio-console
```
The default options are used, so `tokio-console` should connect to the running `zebrad` without other configuration.
### Example
<img width="788" alt="image" src="https://user-images.githubusercontent.com/552961/174457604-53c6ffc6-64f6-4952-94c6-ac7eb37c3871.png">
### More
For more details, see the [`tokio` docs][enabling_tokio_instrumentation].
[top]: https://github.com/tokio-rs/console#extremely-cool-and-amazing-screenshots
[install]: https://github.com/tokio-rs/console#running-the-console]
[enabling_tokio_instrumentation]: https://github.com/tokio-rs/console/blob/main/console-subscriber/README.md#enabling-tokio-instrumentation