Skip to main content

Class: PerformanceMonitor

Defined in: utils/performance/performanceMonitor.ts:18

Tracks operation timings when performance monitoring is enabled.

Constructors​

Constructor​

new PerformanceMonitor(runtime?: PerformanceMonitorRuntime): PerformanceMonitor;

Defined in: utils/performance/performanceMonitor.ts:23

Parameters​

runtime?​

PerformanceMonitorRuntime = ...

Returns​

PerformanceMonitor

Properties​

enabled​

private enabled: boolean;

Defined in: utils/performance/performanceMonitor.ts:19


timers​

private readonly timers: Map<string, PerformanceTimer>;

Defined in: utils/performance/performanceMonitor.ts:21


runtime​

private readonly runtime: PerformanceMonitorRuntime;

Defined in: utils/performance/performanceMonitor.ts:24

Methods​

clearTimers()​

clearTimers(): void;

Defined in: utils/performance/performanceMonitor.ts:36

Clear all tracked timers.

Returns​

void


endTimer()​

endTimer(operationId: string): number | null;

Defined in: utils/performance/performanceMonitor.ts:43

End a performance timer and return its duration in milliseconds.

Parameters​

operationId​

string

Returns​

number | null


getAllTimers()​

getAllTimers(): Map<string, PerformanceTimer>;

Defined in: utils/performance/performanceMonitor.ts:68

Return a snapshot of all timer data.

Returns​

Map<string, PerformanceTimer>


getTimer()​

getTimer(operationId: string): PerformanceTimer | null;

Defined in: utils/performance/performanceMonitor.ts:75

Return timer information for an operation.

Parameters​

operationId​

string

Returns​

PerformanceTimer | null


isEnabled()​

isEnabled(): boolean;

Defined in: utils/performance/performanceMonitor.ts:82

Check whether performance monitoring is enabled.

Returns​

boolean


setEnabled()​

setEnabled(enabled: boolean): void;

Defined in: utils/performance/performanceMonitor.ts:89

Enable or disable performance monitoring.

Parameters​

enabled​

boolean

Returns​

void


startTimer()​

startTimer(operationId: string): void;

Defined in: utils/performance/performanceMonitor.ts:96

Start a performance timer for an operation.

Parameters​

operationId​

string

Returns​

void