优化:推理性能日志改为周期汇总输出

This commit is contained in:
2026-03-31 16:08:53 +08:00
parent 5dd9dc15d5
commit 714361b57f
2 changed files with 40 additions and 10 deletions

View File

@@ -222,15 +222,6 @@ class StructuredLogger:
duration_ms: Optional[float] = None, **tags):
"""记录性能指标"""
self._performance_logger.record(metric_name, value, tags)
perf_data = {
"metric": metric_name,
"value": value,
"duration_ms": duration_ms,
"tags": tags
}
self.info(f"性能指标: {metric_name} = {value}", **perf_data)
def log_inference_latency(self, latency_ms: float, batch_size: int = 1):
"""记录推理延迟"""