nezha/model/monitor_history.go

24 lines
449 B
Go
Raw Normal View History

package model
import (
pb "github.com/naiba/nezha/proto"
)
2022-04-11 10:51:02 -04:00
// 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(),
}
}