修复流量统计

This commit is contained in:
qaq
2025-06-18 14:41:25 +08:00
parent c3077b2922
commit 6df61832b9
9 changed files with 554 additions and 88 deletions
+2 -2
View File
@@ -36,13 +36,13 @@ func StartTrafficReporter(trafficMgr traffic.Manager) {
return
}
ticker := time.NewTicker(1 * time.Second)
ticker := time.NewTicker(5 * time.Second)
go func() {
defer ticker.Stop()
for range ticker.C {
ctx, cancel := context.WithTimeout(context.Background(), 1*time.Second)
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second)
// 先获取流量统计(不清零)
stats, err := trafficMgr.GetAllServicesStats(ctx)