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 pair. Each symbol-strategy combination gets its own isolated storage instance.
track: any
Processes performance events and accumulates metrics. Should be called from performance tracking code.
getData: (symbol: string, strategyName: string) => Promise<PerformanceStatistics>
Gets aggregated performance statistics for a symbol-strategy pair.
getReport: (symbol: string, strategyName: string) => Promise<string>
Generates markdown report with performance analysis.
dump: (symbol: string, strategyName: string, path?: string) => Promise<void>
Saves performance report to disk.
clear: (ctx?: { symbol: string; strategyName: string; }) => Promise<void>
Clears accumulated performance data from storage.
init: (() => Promise<void>) & ISingleshotClearable
Initializes the service by subscribing to performance events. Uses singleshot to ensure initialization happens only once.