Documentation
¶
Index ¶
- Constants
- type AggregatedAlert
- type AlertReceiver
- type AlertRunner
- type AliveReporter
- type BroadcastInfo
- type BroadcastReceiver
- type ConfigAlert
- type ConfigPolicy
- type Executor
- func (e *Executor) AddAlert(alertId string)
- func (e *Executor) CheckExist() bool
- func (e *Executor) DeleteAllAlerts()
- func (e *Executor) GetName() string
- func (e *Executor) GetRunners() []rs.RunnerInfo
- func (e *Executor) GetTaskCount() int
- func (e *Executor) HeartBoot()
- func (e *Executor) ProcessAlert(alertId string, operation string)
- func (e *Executor) Serve()
- func (e *Executor) TerminateRunner(alertId string)
- type ExecutorInfo
- type HealthChecker
- type MonitoringRequest
- type RecordedMetric
- type RuleInfo
- type Runner
- type StatusAlert
- type StatusResource
- type UpdateRequest
Constants ¶
View Source
const (
TickPeriodSecond = 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AggregatedAlert ¶
type AggregatedAlert struct { CumulatedCount uint32 `json:"cumulated_count"` FirstAlertTime string `json:"first_alert_time"` LastAlertTime string `json:"last_alert_time"` LastAlertValues []RecordedMetric `json:"last_alert_values"` }
type AlertReceiver ¶
type AlertReceiver struct {
// contains filtered or unexported fields
}
func NewAlertReceiver ¶
func NewAlertReceiver() *AlertReceiver
func (*AlertReceiver) ExtractAlerts ¶
func (ar *AlertReceiver) ExtractAlerts() error
func (*AlertReceiver) HandleAlert ¶
func (ar *AlertReceiver) HandleAlert(handlerNum string)
func (*AlertReceiver) Serve ¶
func (ar *AlertReceiver) Serve()
func (*AlertReceiver) SetExecutor ¶
func (ar *AlertReceiver) SetExecutor(executor *Executor)
type AlertRunner ¶
type AlertRunner struct { AlertConfig ConfigAlert AlertStatus StatusAlert SignalCh chan string UpdateCh chan string }
func NewAlertRunner ¶
func NewAlertRunner(alertId string, updateCh chan string) *AlertRunner
func (*AlertRunner) GetAlertStatus ¶
func (ar *AlertRunner) GetAlertStatus() (string, time.Time)
func (*AlertRunner) Run ¶
func (ar *AlertRunner) Run(initStatus string)
type AliveReporter ¶
type AliveReporter struct {
// contains filtered or unexported fields
}
func NewAliveReporter ¶
func NewAliveReporter() *AliveReporter
func (*AliveReporter) CheckExist ¶
func (ar *AliveReporter) CheckExist() bool
func (*AliveReporter) HeartBeat ¶
func (ar *AliveReporter) HeartBeat()
func (*AliveReporter) HeartBoot ¶
func (ar *AliveReporter) HeartBoot()
func (*AliveReporter) SetExecutor ¶
func (ar *AliveReporter) SetExecutor(executor *Executor)
type BroadcastInfo ¶
BroadcastInfo is the service register information to etcd
type BroadcastReceiver ¶
type BroadcastReceiver struct {
// contains filtered or unexported fields
}
func NewBroadcastReceiver ¶
func NewBroadcastReceiver() *BroadcastReceiver
func (*BroadcastReceiver) SetExecutor ¶
func (br *BroadcastReceiver) SetExecutor(executor *Executor)
func (*BroadcastReceiver) WatchBroadcast ¶
func (br *BroadcastReceiver) WatchBroadcast()
type ConfigAlert ¶
type ConfigAlert struct { AlertId string LoadSuccess bool Disabled bool RsTypeName string RsTypeParam string RsFilterName string RsFilterParam string PolicyConfig map[string]ConfigPolicy `json:"policy_config"` AvailableStartTime string AvailableEndTime string Language string Rules map[string]RuleInfo Requests MonitoringRequest NfAddressListId string }
type ConfigPolicy ¶
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
func NewExecutor(name string, alertReceiver *AlertReceiver, aliveReporter *AliveReporter, broadcastReceiver *BroadcastReceiver, healthChecker *HealthChecker) *Executor
func (*Executor) CheckExist ¶
func (*Executor) DeleteAllAlerts ¶
func (e *Executor) DeleteAllAlerts()
func (*Executor) GetRunners ¶
func (e *Executor) GetRunners() []rs.RunnerInfo
func (*Executor) GetTaskCount ¶
func (*Executor) ProcessAlert ¶
func (*Executor) TerminateRunner ¶
type ExecutorInfo ¶
ExecutorInfo is the service register information to etcd
type HealthChecker ¶
type HealthChecker struct { UpdateCh chan string RequestStatus UpdateRequest // contains filtered or unexported fields }
func NewHealthChecker ¶
func NewHealthChecker() *HealthChecker
func (*HealthChecker) HealthCheck ¶
func (hc *HealthChecker) HealthCheck()
func (*HealthChecker) SetExecutor ¶
func (hc *HealthChecker) SetExecutor(executor *Executor)
func (*HealthChecker) UpdateLoop ¶
func (hc *HealthChecker) UpdateLoop()
type MonitoringRequest ¶
type RecordedMetric ¶
type StatusAlert ¶
type StatusResource ¶
type StatusResource struct { CurrentLevel string `json:current_level` PositiveCount uint32 `json:positive_count` CumulatedSendCount uint32 `json:cumulated_send_count` NextResendInterval uint32 `json:next_resend_interval` NextSendableTime time.Time `json:next_sendable_time` AggregatedAlerts AggregatedAlert `json:aggregated_alerts` }
type UpdateRequest ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.