UNPKG

@oaklean/profiler

Version:

A library to measure the energy consumption of your javascript/typescript code

42 lines (41 loc) 1.59 kB
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 _platform; private _fileWatcher; private _eventHandler; private cleanExit; constructor(options: IWindowsSensorInterfaceOptions, debugOptions?: { startTime: NanoSeconds_BigInt; stopTime: NanoSeconds_BigInt; offsetTime: number; platform?: SupportedPlatforms; }); measurementStarted(): Promise<void>; 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>; }