diff options
Diffstat (limited to 'cli')
-rw-r--r-- | cli/diagnostics.rs | 1 | ||||
-rw-r--r-- | cli/dts/lib.deno.ns.d.ts | 18 | ||||
-rw-r--r-- | cli/dts/lib.deno.unstable.d.ts | 21 | ||||
-rw-r--r-- | cli/tests/testdata/run/unstable.js | 2 | ||||
-rw-r--r-- | cli/tests/testdata/run/unstable.ts | 2 | ||||
-rw-r--r-- | cli/tests/testdata/run/unstable_disabled.out | 6 | ||||
-rw-r--r-- | cli/tests/testdata/run/unstable_enabled.out | 2 | ||||
-rw-r--r-- | cli/tests/testdata/run/unstable_enabled_js.out | 2 |
8 files changed, 25 insertions, 29 deletions
diff --git a/cli/diagnostics.rs b/cli/diagnostics.rs index e0ac5e0b7..4e456b444 100644 --- a/cli/diagnostics.rs +++ b/cli/diagnostics.rs @@ -42,7 +42,6 @@ const UNSTABLE_DENO_PROPS: &[&str] = &[ "kill", "listen", "listenDatagram", - "loadavg", "dlopen", "osRelease", "ppid", 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 @@ -245,27 +245,6 @@ declare namespace Deno { /** **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. * * ```ts diff --git a/cli/tests/testdata/run/unstable.js b/cli/tests/testdata/run/unstable.js index a9894be3e..8c01b214e 100644 --- a/cli/tests/testdata/run/unstable.js +++ b/cli/tests/testdata/run/unstable.js @@ -1 +1 @@ -console.log(Deno.loadavg); +console.log(Deno.umask); diff --git a/cli/tests/testdata/run/unstable.ts b/cli/tests/testdata/run/unstable.ts index a9894be3e..8c01b214e 100644 --- a/cli/tests/testdata/run/unstable.ts +++ b/cli/tests/testdata/run/unstable.ts @@ -1 +1 @@ -console.log(Deno.loadavg); +console.log(Deno.umask); diff --git a/cli/tests/testdata/run/unstable_disabled.out b/cli/tests/testdata/run/unstable_disabled.out index 28659645d..f3de913e6 100644 --- a/cli/tests/testdata/run/unstable_disabled.out +++ b/cli/tests/testdata/run/unstable_disabled.out @@ -1,5 +1,5 @@ [WILDCARD] -error: TS2339 [ERROR]: Property 'loadavg' does not exist on type 'typeof Deno'. 'Deno.loadavg' is an unstable API. Did you forget to run with the '--unstable' flag? -console.log(Deno.loadavg); - ~~~~~~~ +error: TS2339 [ERROR]: Property 'umask' does not exist on type 'typeof Deno'. 'Deno.umask' is an unstable API. Did you forget to run with the '--unstable' flag? +console.log(Deno.umask); + ~~~~~ at [WILDCARD]/unstable.ts:1:18 diff --git a/cli/tests/testdata/run/unstable_enabled.out b/cli/tests/testdata/run/unstable_enabled.out index b4cedce14..5f88c778c 100644 --- a/cli/tests/testdata/run/unstable_enabled.out +++ b/cli/tests/testdata/run/unstable_enabled.out @@ -1 +1 @@ -[Function: loadavg] +[Function: umask] diff --git a/cli/tests/testdata/run/unstable_enabled_js.out b/cli/tests/testdata/run/unstable_enabled_js.out index b4cedce14..5f88c778c 100644 --- a/cli/tests/testdata/run/unstable_enabled_js.out +++ b/cli/tests/testdata/run/unstable_enabled_js.out @@ -1 +1 @@ -[Function: loadavg] +[Function: umask] |