任意时间区间(月流量)统计,无视重启~

This commit is contained in:
naiba
2021-07-14 23:53:37 +08:00
parent dff1e29c40
commit 63bb1570d2
16 changed files with 290 additions and 77 deletions

View File

@@ -109,7 +109,7 @@ func checkStatus() {
for _, server := range ServerList {
// 监测点
alertsStore[alert.ID][server.ID] = append(alertsStore[alert.
ID][server.ID], alert.Snapshot(server))
ID][server.ID], alert.Snapshot(server, DB))
// 发送通知,分为触发报警和恢复通知
max, passed := alert.Check(alertsStore[alert.ID][server.ID])
if !passed {

View File

@@ -13,7 +13,7 @@ import (
pb "github.com/naiba/nezha/proto"
)
var Version = "v0.8.6" // !!记得修改 README 中的 badge 版本!!
var Version = "v0.9.0" // !!记得修改 README 中的 badge 版本!!
var (
Conf *model.Config

View File

@@ -12,7 +12,7 @@ import (
pb "github.com/naiba/nezha/proto"
)
const _CurrentStatusSize = 30 // 统计 5 分钟内的数据为当前状态
const _CurrentStatusSize = 30 // 统计 15 分钟内的数据为当前状态
var ServiceSentinelShared *ServiceSentinel