diff options
Diffstat (limited to 'runtime/ops/runtime.rs')
-rw-r--r-- | runtime/ops/runtime.rs | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/runtime/ops/runtime.rs b/runtime/ops/runtime.rs index a02bf4548..7d84fadff 100644 --- a/runtime/ops/runtime.rs +++ b/runtime/ops/runtime.rs @@ -1,13 +1,8 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -use crate::metrics::OpMetrics; -use crate::metrics::RuntimeMetrics; -use crate::ops::UnstableChecker; use crate::permissions::Permissions; use deno_core::error::AnyError; use deno_core::error::Context; -use deno_core::serde_json::json; -use deno_core::serde_json::Value; use deno_core::ModuleSpecifier; use deno_core::OpState; use deno_core::ZeroCopyBuf; @@ -19,7 +14,6 @@ pub fn init(rt: &mut deno_core::JsRuntime, main_module: ModuleSpecifier) { state.put::<ModuleSpecifier>(main_module); } super::reg_sync(rt, "op_main_module", op_main_module); - super::reg_sync(rt, "op_metrics", op_metrics); } fn op_main_module( @@ -41,32 +35,6 @@ fn op_main_module( Ok(main) } -#[derive(serde::Serialize)] -struct MetricsReturn { - combined: OpMetrics, - ops: Value, -} - -#[allow(clippy::unnecessary_wraps)] -fn op_metrics( - state: &mut OpState, - _args: (), - _zero_copy: Option<ZeroCopyBuf>, -) -> Result<MetricsReturn, AnyError> { - let m = state.borrow::<RuntimeMetrics>(); - let combined = m.combined_metrics(); - let unstable_checker = state.borrow::<UnstableChecker>(); - let maybe_ops = if unstable_checker.unstable { - Some(&m.ops) - } else { - None - }; - Ok(MetricsReturn { - combined, - ops: json!(maybe_ops), - }) -} - pub fn ppid() -> i64 { #[cfg(windows)] { |