fix 异步定时服务

This commit is contained in:
jxxghp
2025-08-25 21:19:07 +08:00
parent 91a124ab8f
commit 6379cda148
4 changed files with 12 additions and 14 deletions
+2 -2
View File
@@ -78,7 +78,7 @@ class FastAPIMonitor:
# 告警状态
self.alerts: List[str] = []
logger.info("FastAPI性能监控器已初始化")
logger.debug("FastAPI性能监控器已初始化")
def record_request(self, request: Request, response: Response, response_time: float):
"""
@@ -172,7 +172,7 @@ class FastAPIMonitor:
'count': 0,
'total_time': 0,
'errors': 0,
'avg_time': 0
'avg_time': 0.0
})
for req in self.request_history: