nervosnetwork / ckb

The Nervos CKB is a public permissionless blockchain, and the layer 1 of Nervos network.
https://www.nervos.org
MIT License
1.15k stars 228 forks source link

Add `tokio-trace` feature for `tokio-console` debug tool #4417

Closed eval-exec closed 4 months ago

eval-exec commented 4 months ago

What problem does this PR solve?

Add tokio-trace feature for ckb, then we can use https://github.com/tokio-rs/console to debug tokio related code.

There are some envs can affect this feature's behavior:

    /// | `TOKIO_CONSOLE_RETENTION`        | The duration of seconds to accumulate completed tracing data | 3600s (1h)        |
    /// | `TOKIO_CONSOLE_BIND`             | a HOST:PORT description, such as `localhost:1234`            | `127.0.0.1:6669`  |
    /// | `TOKIO_CONSOLE_PUBLISH_INTERVAL` | The duration to wait between sending updates to the console  | 1000ms (1s)       |
    /// | `TOKIO_CONSOLE_RECORD_PATH`      | The file path to save a recording                            | None              |

Multiple ckb nodes should use different TOKIO_CONSOLE_BIND. If they all use the same TOKIO_CONSOLE_BIND, the tokio-console will not display anything.

image

image

Related changes

Check List

Tests

Side effects

Release note

Title Only: Include only the PR title in the release note.