2021-01-16 00:45:49 +08:00
|
|
|
package model
|
|
|
|
|
|
|
|
import (
|
|
|
|
pb "github.com/naiba/nezha/proto"
|
|
|
|
)
|
|
|
|
|
2022-04-11 22:51:02 +08:00
|
|
|
// MonitorHistory 历史监控记录
|
2021-01-16 00:45:49 +08:00
|
|
|
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(),
|
|
|
|
}
|
|
|
|
}
|