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