From 21af125bfa453d0f3a04a3aba8f8e62aaff09c56 Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 20 Jun 2022 23:38:12 -0400 Subject: [PATCH] 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> --- book/src/dev/tokio-console.md | 38 +++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 book/src/dev/tokio-console.md diff --git a/book/src/dev/tokio-console.md b/book/src/dev/tokio-console.md new file mode 100644 index 00000000..4a10d27e --- /dev/null +++ b/book/src/dev/tokio-console.md @@ -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 + +image + + +### 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 +