@oaklean/profiler
Version:
A library to measure the energy consumption of your javascript/typescript code
32 lines (31 loc) • 1.24 kB
TypeScript
import { MetricsDataCollection, IPowerMetricsSensorInterfaceOptions, NanoSeconds_BigInt, SensorInterfaceType } from '@oaklean/profiler-core';
import { BaseSensorInterface } from '../BaseSensorInterface';
/**
* This SensorInterface uses the data provided by the powermetrics command line tool.
* This Provider can only be used on Mac OS
*
* Man Page to powermetrics:
* https://www.unix.com/man-page/osx/1/powermetrics/
*/
export declare class PowerMetricsSensorInterface extends BaseSensorInterface {
private _executable;
private _options;
private _commandLineArgs;
private _childProcess;
private _startTime;
private _stopTime;
private cleanExit;
constructor(options: IPowerMetricsSensorInterfaceOptions, debugOptions?: {
startTime: NanoSeconds_BigInt;
stopTime: NanoSeconds_BigInt;
});
type(): SensorInterfaceType;
canBeExecuted(): Promise<boolean>;
isRunning(): boolean;
static runningInstances(): string[];
readSensorValues(pid: number): Promise<MetricsDataCollection | undefined>;
get startTime(): NanoSeconds_BigInt | undefined;
get stopTime(): NanoSeconds_BigInt | undefined;
startProfiling(): Promise<void>;
stopProfiling(): Promise<void>;
}