Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewScheduler ¶
func NewScheduler(cfg SchedulerCfg, stateManager *state.Manager) *schedule
NewScheduler returns a new schedule.
func SchedulerUserFor ¶
func SchedulerUserFor(orgID int64) *user.SignedInUser
Types ¶
type AlertsSender ¶
type AlertsSender interface {
Send(key ngmodels.AlertRuleKey, alerts definitions.PostableAlerts)
}
AlertsSender is an interface for a service that is responsible for sending notifications to the end-user.
type AlertsSenderMock ¶
AlertsSenderMock is an autogenerated mock type for the AlertsSender type
func (*AlertsSenderMock) EXPECT ¶
func (_m *AlertsSenderMock) EXPECT() *AlertsSenderMock_Expecter
func (*AlertsSenderMock) Send ¶
func (_m *AlertsSenderMock) Send(key models.AlertRuleKey, alerts definitions.PostableAlerts)
Send provides a mock function with given fields: key, alerts
type AlertsSenderMock_Expecter ¶
type AlertsSenderMock_Expecter struct {
// contains filtered or unexported fields
}
func (*AlertsSenderMock_Expecter) Send ¶
func (_e *AlertsSenderMock_Expecter) Send(key interface{}, alerts interface{}) *AlertsSenderMock_Send_Call
Send is a helper method to define mock.On call
- key models.AlertRuleKey
- alerts definitions.PostableAlerts
type AlertsSenderMock_Send_Call ¶
AlertsSenderMock_Send_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Send'
func (*AlertsSenderMock_Send_Call) Return ¶
func (_c *AlertsSenderMock_Send_Call) Return() *AlertsSenderMock_Send_Call
func (*AlertsSenderMock_Send_Call) Run ¶
func (_c *AlertsSenderMock_Send_Call) Run(run func(key models.AlertRuleKey, alerts definitions.PostableAlerts)) *AlertsSenderMock_Send_Call
type RulesStore ¶
type RulesStore interface { GetAlertRulesKeysForScheduling(ctx context.Context) ([]ngmodels.AlertRuleKeyWithVersion, error) GetAlertRulesForScheduling(ctx context.Context, query *ngmodels.GetAlertRulesForSchedulingQuery) error }
RulesStore is a store that provides alert rules for scheduling
type ScheduleService ¶
type ScheduleService interface { // Run the scheduler until the context is canceled or the scheduler returns // an error. The scheduler is terminated when this function returns. Run(context.Context) error }
ScheduleService is an interface for a service that schedules the evaluation of alert rules.
type SchedulerCfg ¶
type SchedulerCfg struct { MaxAttempts int64 BaseInterval time.Duration C clock.Clock MinRuleInterval time.Duration DisableGrafanaFolder bool AppURL *url.URL EvaluatorFactory eval.EvaluatorFactory RuleStore RulesStore Metrics *metrics.Scheduler AlertSender AlertsSender Tracer tracing.Tracer }
SchedulerCfg is the scheduler configuration.
Click to show internal directories.
Click to hide internal directories.