mirror of
https://github.com/nezhahq/nezha.git
synced 2025-01-23 05:08:13 -05:00
23 lines
412 B
Go
23 lines
412 B
Go
package model
|
|
|
|
import (
|
|
pb "github.com/naiba/nezha/proto"
|
|
)
|
|
|
|
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(),
|
|
}
|
|
}
|