@oaklean/profiler
Version:
A library to measure the energy consumption of your javascript/typescript code
38 lines (37 loc) • 1.48 kB
TypeScript
import { MetricsDataCollection, IWindowsSensorInterfaceOptions, NanoSeconds_BigInt, SensorInterfaceType } from '@oaklean/profiler-core';
import { SupportedPlatforms } from '@oaklean/windows-sensorinterface';
import { BaseSensorInterface } from '../BaseSensorInterface';
/**
* This SensorInterface uses the data provided by the libre hardware monitor command line tool.
* This Provider can only be used on Windows
*/
export declare enum WindowsSensorInterfaceEvent {
ENERGY_CPU_PACKAGE = "CPU Package",
ENERGY_GPU = "GPU Power"
}
export declare class WindowsSensorInterface extends BaseSensorInterface {
private _executable;
private _options;
private _childProcess;
private _offsetTime;
private _startTime;
private _stopTime;
private cleanExit;
constructor(options: IWindowsSensorInterfaceOptions, debugOptions?: {
startTime: NanoSeconds_BigInt;
stopTime: NanoSeconds_BigInt;
offsetTime: number;
platform?: SupportedPlatforms;
});
type(): SensorInterfaceType;
executable(): string;
canBeExecuted(): Promise<boolean>;
commandLineArgs(): Promise<string[]>;
isRunning(): boolean;
getOutputContent(): string | undefined;
readSensorValues(pid: number): Promise<MetricsDataCollection | undefined>;
get startTime(): NanoSeconds_BigInt | undefined;
get stopTime(): NanoSeconds_BigInt | undefined;
startProfiling(): Promise<void>;
stopProfiling(): Promise<void>;
}