feat: 移除 PerformanceMonitor 调试日志
This commit is contained in:
@@ -58,11 +58,6 @@ const performanceMeasures: Array<{ name: string; duration: number; startMark: st
|
|||||||
*/
|
*/
|
||||||
class PerformanceMonitor {
|
class PerformanceMonitor {
|
||||||
private metrics: PerformanceMetrics = {};
|
private metrics: PerformanceMetrics = {};
|
||||||
private isProduction: boolean;
|
|
||||||
|
|
||||||
constructor() {
|
|
||||||
this.isProduction = process.env.NODE_ENV === 'production';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 标记性能时间点
|
* 标记性能时间点
|
||||||
@@ -70,12 +65,6 @@ class PerformanceMonitor {
|
|||||||
mark(name: string): void {
|
mark(name: string): void {
|
||||||
const timestamp = performance.now();
|
const timestamp = performance.now();
|
||||||
performanceMarks.set(name, timestamp);
|
performanceMarks.set(name, timestamp);
|
||||||
|
|
||||||
if (!this.isProduction) {
|
|
||||||
logger.debug('PerformanceMonitor', `⏱️ Mark: ${name}`, {
|
|
||||||
time: `${timestamp.toFixed(2)}ms`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -106,12 +95,6 @@ class PerformanceMonitor {
|
|||||||
endMark
|
endMark
|
||||||
});
|
});
|
||||||
|
|
||||||
if (!this.isProduction) {
|
|
||||||
logger.debug('PerformanceMonitor', `📊 Measure: ${measureName}`, {
|
|
||||||
duration: `${duration.toFixed(2)}ms`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
return duration;
|
return duration;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user