Service for collecting and analyzing performance metrics.
Features:
constructor();
loggerService: any
Logger service for debug output
getStorage: any
Memoized function to get or create PerformanceStorage for a symbol-strategy-exchange-frame-backtest combination. Each combination gets its own isolated storage instance.
subscribe: (() => () => void) & ISingleshotClearable
Subscribes to performance emitter to receive performance events. Protected against multiple subscriptions. Returns an unsubscribe function to stop receiving events.
unsubscribe: () => Promise<void>
Unsubscribes from performance emitter to stop receiving events. Calls the unsubscribe function returned by subscribe(). If not subscribed, does nothing.
track: any
Processes performance events and accumulates metrics. Should be called from performance tracking code.
getData: (symbol: string, strategyName: string, exchangeName: string, frameName: string, backtest: boolean) => Promise<PerformanceStatisticsModel>
Gets aggregated performance statistics for a symbol-strategy pair.
getReport: (symbol: string, strategyName: string, exchangeName: string, frameName: string, backtest: boolean, columns?: Columns$4[]) => Promise<string>
Generates markdown report with performance analysis.
dump: (symbol: string, strategyName: string, exchangeName: string, frameName: string, backtest: boolean, path?: string, columns?: Columns$4[]) => Promise<void>
Saves performance report to disk.
clear: (payload?: { symbol: string; strategyName: string; exchangeName: string; frameName: string; backtest: boolean; }) => Promise<void>
Clears accumulated performance data from storage.