From 606db35ccbe8e3c1ce93ae943a2f9850558400af Mon Sep 17 00:00:00 2001 From: Colin Ihrig Date: Tue, 25 Oct 2022 11:21:14 -0400 Subject: feat: stabilize Deno.loadavg() (#16412) --- cli/dts/lib.deno.ns.d.ts | 18 ++++++++++++++++++ cli/dts/lib.deno.unstable.d.ts | 21 --------------------- 2 files changed, 18 insertions(+), 21 deletions(-) (limited to 'cli/dts') diff --git a/cli/dts/lib.deno.ns.d.ts b/cli/dts/lib.deno.ns.d.ts index 34d85ac87..ed6e8ad4f 100644 --- a/cli/dts/lib.deno.ns.d.ts +++ b/cli/dts/lib.deno.ns.d.ts @@ -314,6 +314,24 @@ declare namespace Deno { */ export function hostname(): string; + /** + * Returns an array containing the 1, 5, and 15 minute load averages. The + * load average is a measure of CPU and IO utilization of the last one, five, + * and 15 minute periods expressed as a fractional number. Zero means there + * is no load. On Windows, the three values are always the same and represent + * the current load, not the 1, 5 and 15 minute load averages. + * + * ```ts + * console.log(Deno.loadavg()); // e.g. [ 0.71, 0.44, 0.44 ] + * ``` + * + * Requires `allow-sys` permission. + * + * @tags allow-sys + * @category Observability + */ + export function loadavg(): number[]; + /** Reflects the `NO_COLOR` environment variable at program start. * * When the value is `true`, the Deno CLI will attempt to not send color codes diff --git a/cli/dts/lib.deno.unstable.d.ts b/cli/dts/lib.deno.unstable.d.ts index 85b5911f8..1085c7039 100644 --- a/cli/dts/lib.deno.unstable.d.ts +++ b/cli/dts/lib.deno.unstable.d.ts @@ -243,27 +243,6 @@ declare namespace Deno { rows: number; }; - /** **UNSTABLE**: New API, yet to be vetted. - * - * Returns an array containing the 1, 5, and 15 minute load averages. The - * load average is a measure of CPU and IO utilization of the last one, five, - * and 15 minute periods expressed as a fractional number. Zero means there - * is no load. On Windows, the three values are always the same and represent - * the current load, not the 1, 5 and 15 minute load averages. - * - * ```ts - * console.log(Deno.loadavg()); // e.g. [ 0.71, 0.44, 0.44 ] - * ``` - * - * Requires `allow-sys` permission. - * There are questions around which permission this needs. And maybe should be - * renamed (loadAverage?). - * - * @tags allow-sys - * @category Observability - */ - export function loadavg(): number[]; - /** **UNSTABLE**: New API, yet to be vetted. * * Returns the release version of the Operating System. -- cgit v1.2.3