2020-01-02 15:13:47 -05:00
|
|
|
// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
|
2020-03-08 13:09:22 +01:00
|
|
|
|
2019-09-02 17:07:11 -04:00
|
|
|
import { sendSync } from "./dispatch_json.ts";
|
2018-10-05 19:21:15 +02:00
|
|
|
|
2020-03-08 13:09:22 +01:00
|
|
|
export interface Start {
|
|
|
|
args: string[];
|
2020-04-30 17:23:40 +02:00
|
|
|
cwd: string;
|
2020-03-08 13:09:22 +01:00
|
|
|
debugFlag: boolean;
|
|
|
|
denoVersion: string;
|
|
|
|
noColor: boolean;
|
2020-04-30 17:23:40 +02:00
|
|
|
pid: number;
|
|
|
|
repl: boolean;
|
2020-04-28 12:35:23 -04:00
|
|
|
target: string;
|
2020-04-30 17:23:40 +02:00
|
|
|
tsVersion: string;
|
|
|
|
unstableFlag: boolean;
|
|
|
|
v8Version: string;
|
|
|
|
versionFlag: boolean;
|
2020-03-08 13:09:22 +01:00
|
|
|
}
|
|
|
|
|
2020-04-28 12:35:23 -04:00
|
|
|
export function opStart(): Start {
|
2020-03-08 13:09:22 +01:00
|
|
|
return sendSync("op_start");
|
|
|
|
}
|
|
|
|
|
2019-02-14 00:50:15 +11:00
|
|
|
export interface Metrics {
|
2018-10-05 19:21:15 +02:00
|
|
|
opsDispatched: number;
|
2020-03-02 19:13:36 +01:00
|
|
|
opsDispatchedSync: number;
|
|
|
|
opsDispatchedAsync: number;
|
|
|
|
opsDispatchedAsyncUnref: number;
|
2018-10-05 19:21:15 +02:00
|
|
|
opsCompleted: number;
|
2020-03-02 19:13:36 +01:00
|
|
|
opsCompletedSync: number;
|
|
|
|
opsCompletedAsync: number;
|
|
|
|
opsCompletedAsyncUnref: number;
|
2018-10-05 19:21:15 +02:00
|
|
|
bytesSentControl: number;
|
|
|
|
bytesSentData: number;
|
|
|
|
bytesReceived: number;
|
|
|
|
}
|
|
|
|
|
2019-03-10 04:30:38 +11:00
|
|
|
export function metrics(): Metrics {
|
2020-02-25 09:14:27 -05:00
|
|
|
return sendSync("op_metrics");
|
2019-03-10 04:30:38 +11:00
|
|
|
}
|