mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-05 13:10:07 +00:00
✨ [0.9.19] 进程数/连接数/负载 监控报警
This commit is contained in:
@@ -265,10 +265,8 @@ func doTask(task *pb.Task) {
|
||||
func reportState() {
|
||||
var lastReportHostInfo time.Time
|
||||
var err error
|
||||
var now time.Time
|
||||
defer println("reportState exit", time.Now(), "=>", err)
|
||||
for {
|
||||
now = time.Now()
|
||||
// 为了更准确的记录时段流量,inited 后再上传状态信息
|
||||
if client != nil && inited {
|
||||
monitor.TrackNetworkSpeed()
|
||||
@@ -284,7 +282,7 @@ func reportState() {
|
||||
client.ReportSystemInfo(context.Background(), monitor.GetHost().PB())
|
||||
}
|
||||
}
|
||||
time.Sleep(time.Until(now.Add(time.Second)))
|
||||
time.Sleep(time.Second)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user