diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2023-06-09 13:52:51 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-09 11:52:51 +0000 |
commit | 168eb8e01d3cdbd6358e11cf399fbf4ef1db358b (patch) | |
tree | 1bd50c52c039ea808658d2d470da2b121321a4d7 /cli | |
parent | 1b26f3c726d4835a403765f42a4f760b29b9f57d (diff) |
perf: add Tokio runtime monitor (#19415)
This commit adds ability to print metrics of the Tokio
runtime to the console by passing "DENO_TOKIO_METRICS=1"
env var.
Metrics will be printed every second, but this can be changed
by "DENO_TOKIO_METRICS_INTERVAL=500" env var.
Diffstat (limited to 'cli')
-rw-r--r-- | cli/main.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cli/main.rs b/cli/main.rs index 73820cb93..27dd4bcd8 100644 --- a/cli/main.rs +++ b/cli/main.rs @@ -41,7 +41,7 @@ use deno_core::futures::FutureExt; use deno_core::task::JoinHandle; use deno_runtime::colors; use deno_runtime::fmt_errors::format_js_error; -use deno_runtime::tokio_util::create_and_run_current_thread; +use deno_runtime::tokio_util::create_and_run_current_thread_with_maybe_metrics; use factory::CliFactory; use std::env; use std::env::current_exe; @@ -308,7 +308,8 @@ pub fn main() { run_subcommand(flags).await }; - let exit_code = unwrap_or_exit(create_and_run_current_thread(future)); + let exit_code = + unwrap_or_exit(create_and_run_current_thread_with_maybe_metrics(future)); std::process::exit(exit_code); } |