mirror of
https://github.com/denoland/deno.git
synced 2025-09-26 12:19:12 +00:00
Merge deno_cli_snapshots into deno_cli (#3064)
This commit is contained in:
parent
9049213867
commit
b81e5db17a
148 changed files with 38 additions and 83 deletions
28
cli/js/metrics.ts
Normal file
28
cli/js/metrics.ts
Normal file
|
@ -0,0 +1,28 @@
|
|||
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
|
||||
import * as dispatch from "./dispatch.ts";
|
||||
import { sendSync } from "./dispatch_json.ts";
|
||||
|
||||
export interface Metrics {
|
||||
opsDispatched: number;
|
||||
opsCompleted: number;
|
||||
bytesSentControl: number;
|
||||
bytesSentData: number;
|
||||
bytesReceived: number;
|
||||
}
|
||||
|
||||
/** Receive metrics from the privileged side of Deno.
|
||||
*
|
||||
* > console.table(Deno.metrics())
|
||||
* ┌──────────────────┬────────┐
|
||||
* │ (index) │ Values │
|
||||
* ├──────────────────┼────────┤
|
||||
* │ opsDispatched │ 9 │
|
||||
* │ opsCompleted │ 9 │
|
||||
* │ bytesSentControl │ 504 │
|
||||
* │ bytesSentData │ 0 │
|
||||
* │ bytesReceived │ 856 │
|
||||
* └──────────────────┴────────┘
|
||||
*/
|
||||
export function metrics(): Metrics {
|
||||
return sendSync(dispatch.OP_METRICS);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue