From 504ae362d5d7695ad710bcdf86a0f57fb4fbd113 Mon Sep 17 00:00:00 2001 From: Asher Gomez Date: Sat, 31 Aug 2024 08:43:32 +1000 Subject: [PATCH] chore: remove `Deno.metrics()` (#25167) --- cli/tsc/dts/lib.deno.ns.d.ts | 37 ------------------------- runtime/js/90_deno_ns.js | 4 --- runtime/js/99_main.js | 2 -- tests/specs/future/runtime_api/main.js | 1 - tests/specs/future/runtime_api/main.out | 1 - 5 files changed, 45 deletions(-) diff --git a/cli/tsc/dts/lib.deno.ns.d.ts b/cli/tsc/dts/lib.deno.ns.d.ts index 0cc96d5429..31634811c7 100644 --- a/cli/tsc/dts/lib.deno.ns.d.ts +++ b/cli/tsc/dts/lib.deno.ns.d.ts @@ -4060,43 +4060,6 @@ declare namespace Deno { bytesReceived: number; } - /** @category Runtime - * - * @deprecated This will be removed in Deno 2.0. - */ - export interface Metrics extends OpMetrics { - ops: Record; - } - - /** Receive metrics from the privileged side of Deno. This is primarily used - * in the development of Deno. _Ops_, also called _bindings_, are the - * go-between between Deno JavaScript sandbox and the rest of Deno. - * - * ```shell - * > console.table(Deno.metrics()) - * ┌─────────────────────────┬────────┐ - * │ (index) │ Values │ - * ├─────────────────────────┼────────┤ - * │ opsDispatched │ 3 │ - * │ opsDispatchedSync │ 2 │ - * │ opsDispatchedAsync │ 1 │ - * │ opsDispatchedAsyncUnref │ 0 │ - * │ opsCompleted │ 3 │ - * │ opsCompletedSync │ 2 │ - * │ opsCompletedAsync │ 1 │ - * │ opsCompletedAsyncUnref │ 0 │ - * │ bytesSentControl │ 73 │ - * │ bytesSentData │ 0 │ - * │ bytesReceived │ 375 │ - * └─────────────────────────┴────────┘ - * ``` - * - * @category Runtime - * - * @deprecated This will be removed in Deno 2.0. - */ - export function metrics(): Metrics; - /** * A map of open resources that Deno is tracking. The key is the resource ID * (_rid_) and the value is its representation. diff --git a/runtime/js/90_deno_ns.js b/runtime/js/90_deno_ns.js index cf3e445c9c..7bfae0b7c5 100644 --- a/runtime/js/90_deno_ns.js +++ b/runtime/js/90_deno_ns.js @@ -32,10 +32,6 @@ import * as cron from "ext:deno_cron/01_cron.ts"; import * as webgpuSurface from "ext:deno_webgpu/02_surface.js"; const denoNs = { - metrics: () => { - internals.warnOnDeprecatedApi("Deno.metrics()", new Error().stack); - return core.metrics(); - }, Process: process.Process, run: process.run, isatty: tty.isatty, diff --git a/runtime/js/99_main.js b/runtime/js/99_main.js index 24379b9df1..20de6a0e16 100644 --- a/runtime/js/99_main.js +++ b/runtime/js/99_main.js @@ -946,7 +946,6 @@ function bootstrapMainRuntime(runtimeOptions, warmup = false) { delete Deno.funlockSync; delete Deno.iter; delete Deno.iterSync; - delete Deno.metrics; delete Deno.readAll; delete Deno.readAllSync; delete Deno.read; @@ -1136,7 +1135,6 @@ function bootstrapWorkerRuntime( delete Deno.funlockSync; delete Deno.iter; delete Deno.iterSync; - delete Deno.metrics; delete Deno.readAll; delete Deno.readAllSync; delete Deno.read; diff --git a/tests/specs/future/runtime_api/main.js b/tests/specs/future/runtime_api/main.js index eac8ed194a..d0a138f2e7 100644 --- a/tests/specs/future/runtime_api/main.js +++ b/tests/specs/future/runtime_api/main.js @@ -17,7 +17,6 @@ console.log("Deno.funlock is", Deno.funlock); console.log("Deno.funlockSync is", Deno.funlockSync); console.log("Deno.iter is", Deno.iter); console.log("Deno.iterSync is", Deno.iterSync); -console.log("Deno.metrics is", Deno.metrics); console.log("Deno.readAll is", Deno.readAll); console.log("Deno.readAllSync is", Deno.readAllSync); console.log("Deno.read is", Deno.read); diff --git a/tests/specs/future/runtime_api/main.out b/tests/specs/future/runtime_api/main.out index 4712a06b06..2cbda80054 100644 --- a/tests/specs/future/runtime_api/main.out +++ b/tests/specs/future/runtime_api/main.out @@ -14,7 +14,6 @@ Deno.funlock is undefined Deno.funlockSync is undefined Deno.iter is undefined Deno.iterSync is undefined -Deno.metrics is undefined Deno.readAll is undefined Deno.readAllSync is undefined Deno.read is undefined