2021-01-15 11:45:49 -05:00
|
|
|
package model
|
|
|
|
|
2024-02-18 07:00:36 -05:00
|
|
|
import (
|
|
|
|
"time"
|
|
|
|
|
|
|
|
"gorm.io/gorm"
|
2024-02-12 01:16:04 -05:00
|
|
|
)
|
|
|
|
|
2022-04-11 10:51:02 -04:00
|
|
|
// MonitorHistory 历史监控记录
|
2021-01-15 11:45:49 -05:00
|
|
|
type MonitorHistory struct {
|
2024-02-18 07:00:36 -05:00
|
|
|
ID uint64 `gorm:"primaryKey"`
|
|
|
|
CreatedAt time.Time `gorm:"index;<-:create;index:idx_server_id_created_at_monitor_id_avg_delay"`
|
|
|
|
UpdatedAt time.Time `gorm:"autoUpdateTime"`
|
|
|
|
DeletedAt gorm.DeletedAt `gorm:"index"`
|
|
|
|
MonitorID uint64 `gorm:"index:idx_server_id_created_at_monitor_id_avg_delay"`
|
|
|
|
ServerID uint64 `gorm:"index:idx_server_id_created_at_monitor_id_avg_delay"`
|
|
|
|
AvgDelay float32 `gorm:"index:idx_server_id_created_at_monitor_id_avg_delay"` // 平均延迟,毫秒
|
|
|
|
Up uint64 // 检查状态良好计数
|
|
|
|
Down uint64 // 检查状态异常计数
|
2022-10-12 11:06:25 -04:00
|
|
|
Data string
|
2021-01-15 11:45:49 -05:00
|
|
|
}
|