Documentation ¶
Index ¶
- Variables
- func AlertSentinelStart()
- func CronTrigger(cr model.Cron) func()
- func LoadNotifications()
- func ManualTrigger(c model.Cron)
- func NewServiceSentinel(serviceSentinelDispatchBus chan<- model.Monitor)
- func OnDeleteAlert(id uint64)
- func OnDeleteNotification(id uint64)
- func OnRefreshOrAddAlert(alert model.AlertRule)
- func OnRefreshOrAddNotification(n model.Notification)
- func ReSortServer()
- func SendNotification(desc string, muteable bool)
- type NotificationHistory
- type ReportData
- type ServiceSentinel
- func (ss *ServiceSentinel) Dispatch(r ReportData)
- func (ss *ServiceSentinel) LoadStats() map[uint64]*model.ServiceItemResponse
- func (ss *ServiceSentinel) Monitors() []*model.Monitor
- func (ss *ServiceSentinel) OnMonitorDelete(id uint64)
- func (ss *ServiceSentinel) OnMonitorUpdate(m model.Monitor) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Conf *model.Config Cache *cache.Cache DB *gorm.DB ServerList map[uint64]*model.Server SecretToID map[string]uint64 ServerLock sync.RWMutex SortedServerList []*model.Server SortedServerLock sync.RWMutex )
View Source
var Alerts []*model.AlertRule
View Source
var AlertsCycleTransferStatsStore map[uint64]*model.CycleTransferStats
View Source
var AlertsLock sync.RWMutex
报警规则
View Source
var Cron *cron.Cron
View Source
var CronLock sync.RWMutex
View Source
var Crons map[uint64]*model.Cron
View Source
var Version = "v0.12.2" // !!记得修改 README 中的 badge 版本!!
Functions ¶
func AlertSentinelStart ¶
func AlertSentinelStart()
func CronTrigger ¶
func LoadNotifications ¶ added in v0.10.3
func LoadNotifications()
func ManualTrigger ¶ added in v0.7.1
func NewServiceSentinel ¶ added in v0.4.11
func OnDeleteAlert ¶
func OnDeleteAlert(id uint64)
func OnDeleteNotification ¶
func OnDeleteNotification(id uint64)
func OnRefreshOrAddAlert ¶
func OnRefreshOrAddNotification ¶
func OnRefreshOrAddNotification(n model.Notification)
func ReSortServer ¶
func ReSortServer()
func SendNotification ¶
Types ¶
type NotificationHistory ¶
type ReportData ¶ added in v0.4.11
type ReportData struct { Data *pb.TaskResult Reporter uint64 }
type ServiceSentinel ¶ added in v0.4.11
type ServiceSentinel struct {
// contains filtered or unexported fields
}
使用缓存 channel,处理上报的 Service 请求结果,然后判断是否需要报警 需要记录上一次的状态信息
func (*ServiceSentinel) Dispatch ¶ added in v0.4.11
func (ss *ServiceSentinel) Dispatch(r ReportData)
func (*ServiceSentinel) LoadStats ¶ added in v0.4.11
func (ss *ServiceSentinel) LoadStats() map[uint64]*model.ServiceItemResponse
func (*ServiceSentinel) Monitors ¶ added in v0.4.11
func (ss *ServiceSentinel) Monitors() []*model.Monitor
func (*ServiceSentinel) OnMonitorDelete ¶ added in v0.4.11
func (ss *ServiceSentinel) OnMonitorDelete(id uint64)
func (*ServiceSentinel) OnMonitorUpdate ¶ added in v0.4.11
func (ss *ServiceSentinel) OnMonitorUpdate(m model.Monitor) error
Click to show internal directories.
Click to hide internal directories.