mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 04:30:05 +00:00
🐛 fix service stats
This commit is contained in:
@@ -103,6 +103,8 @@ type Config struct {
|
||||
Cover uint8 // 覆盖范围(0:提醒未被 IgnoredIPNotification 包含的所有服务器; 1:仅提醒被 IgnoredIPNotification 包含的服务器;)
|
||||
IgnoredIPNotification string // 特定服务器IP(多个服务器用逗号分隔)
|
||||
|
||||
Location string // 时区,默认为 Asia/Shanghai
|
||||
|
||||
v *viper.Viper
|
||||
IgnoredIPNotificationServerIDs map[uint64]bool // [ServerID] -> bool(值为true代表当前ServerID在特定服务器列表内)
|
||||
}
|
||||
@@ -136,6 +138,9 @@ func (c *Config) Read(path string) error {
|
||||
if c.EnableIPChangeNotification && c.IPChangeNotificationTag == "" {
|
||||
c.IPChangeNotificationTag = "default"
|
||||
}
|
||||
if c.Location == "" {
|
||||
c.Location = "Asia/Shanghai"
|
||||
}
|
||||
|
||||
c.updateIgnoredIPNotificationID()
|
||||
return nil
|
||||
|
||||
@@ -1,23 +1,11 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
pb "github.com/naiba/nezha/proto"
|
||||
)
|
||||
|
||||
// MonitorHistory 历史监控记录
|
||||
type MonitorHistory struct {
|
||||
Common
|
||||
MonitorID uint64
|
||||
Delay float32 // 延迟,毫秒
|
||||
Data string
|
||||
Successful bool // 是否成功
|
||||
}
|
||||
|
||||
func PB2MonitorHistory(r *pb.TaskResult) MonitorHistory {
|
||||
return MonitorHistory{
|
||||
Delay: r.GetDelay(),
|
||||
Successful: r.GetSuccessful(),
|
||||
MonitorID: r.GetId(),
|
||||
Data: r.GetData(),
|
||||
}
|
||||
MonitorID uint64
|
||||
AvgDelay float32 // 平均延迟,毫秒
|
||||
Up uint64 // 检查状态良好计数
|
||||
Down uint64 // 检查状态异常计数
|
||||
Data string
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user