From 168eb8e01d3cdbd6358e11cf399fbf4ef1db358b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Fri, 9 Jun 2023 13:52:51 +0200 Subject: 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. --- cli/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'cli') 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); } -- cgit v1.2.3