StaticdumpSaves performance report to disk.
Creates directory if it doesn't exist. Default path: ./dump/performance/{strategyName}.md
Strategy name to save report for
Optionalpath: stringOptional custom directory path
StaticgetGets aggregated performance statistics for a symbol-strategy pair.
Returns detailed metrics grouped by operation type:
Trading pair symbol
Strategy name to analyze
Performance statistics with aggregated metrics
const stats = await Performance.getData("BTCUSDT", "my-strategy");
// Find slowest operation type
const slowest = Object.values(stats.metricStats)
.sort((a, b) => b.avgDuration - a.avgDuration)[0];
console.log(`Slowest: ${slowest.metricType} (${slowest.avgDuration.toFixed(2)}ms avg)`);
// Check for outliers
for (const metric of Object.values(stats.metricStats)) {
if (metric.p99 > metric.avgDuration * 5) {
console.warn(`High variance in ${metric.metricType}: P99=${metric.p99}ms, Avg=${metric.avgDuration}ms`);
}
}
StaticgetGenerates markdown report with performance analysis.
Report includes:
Trading pair symbol
Strategy name to generate report for
Markdown formatted report string
Performance class provides static methods for performance metrics analysis.
Features:
Example