1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-27 01:29:14 -05:00
denoland-deno/js/metrics.ts

29 lines
1 KiB
TypeScript
Raw Normal View History

2019-01-21 14:03:30 -05:00
// Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
2019-08-26 08:50:21 -04:00
import * as dispatch from "./dispatch";
import { sendSync } from "./dispatch_json";
2018-10-05 13:21:15 -04:00
2019-02-13 08:50:15 -05:00
export interface Metrics {
2018-10-05 13:21:15 -04:00
opsDispatched: number;
opsCompleted: number;
bytesSentControl: number;
bytesSentData: number;
bytesReceived: number;
}
/** Receive metrics from the privileged side of Deno.
*
2019-04-03 08:53:54 -04:00
* > console.table(Deno.metrics())
*
* (index) Values
*
* opsDispatched 9
* opsCompleted 9
* bytesSentControl 504
* bytesSentData 0
* bytesReceived 856
*
*/
export function metrics(): Metrics {
2019-08-26 08:50:21 -04:00
return sendSync(dispatch.OP_METRICS);
}