schedule

package
v0.0.0-test Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2021 License: AGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NoDataAlertName = "DatasourceNoData"

	Rulename = "rulename"
)

Variables

This section is empty.

Functions

func FromAlertStateToPostableAlerts

func FromAlertStateToPostableAlerts(firingStates []*state.State, stateManager *state.Manager, appURL *url.URL) apimodels.PostableAlerts

func NewScheduler

func NewScheduler(cfg SchedulerCfg, expressionService *expr.Service, appURL *url.URL, stateManager *state.Manager) *schedule

NewScheduler returns a new schedule.

Types

type FakeExternalAlertmanager

type FakeExternalAlertmanager struct {
	// contains filtered or unexported fields
}

func NewFakeExternalAlertmanager

func NewFakeExternalAlertmanager(t *testing.T) *FakeExternalAlertmanager

func (*FakeExternalAlertmanager) AlertNamesCompare

func (am *FakeExternalAlertmanager) AlertNamesCompare(expected []string) bool

func (*FakeExternalAlertmanager) Alerts

func (*FakeExternalAlertmanager) AlertsCount

func (am *FakeExternalAlertmanager) AlertsCount() int

func (*FakeExternalAlertmanager) Close

func (am *FakeExternalAlertmanager) Close()

func (*FakeExternalAlertmanager) Handler

func (am *FakeExternalAlertmanager) Handler() func(w http.ResponseWriter, r *http.Request)

func (*FakeExternalAlertmanager) URL

func (am *FakeExternalAlertmanager) URL() string

type FakeInstanceStore

type FakeInstanceStore struct {
	// contains filtered or unexported fields
}

func (*FakeInstanceStore) DeleteAlertInstance

func (f *FakeInstanceStore) DeleteAlertInstance(_ int64, _, _ string) error

func (*FakeInstanceStore) FetchOrgIds

func (f *FakeInstanceStore) FetchOrgIds() ([]int64, error)

func (*FakeInstanceStore) GetAlertInstance

func (f *FakeInstanceStore) GetAlertInstance(q *models.GetAlertInstanceQuery) error

func (*FakeInstanceStore) ListAlertInstances

func (f *FakeInstanceStore) ListAlertInstances(q *models.ListAlertInstancesQuery) error

func (*FakeInstanceStore) SaveAlertInstance

func (f *FakeInstanceStore) SaveAlertInstance(q *models.SaveAlertInstanceCommand) error

type ScheduleService

type ScheduleService interface {
	Run(context.Context) error
	Pause() error
	Unpause() error
	AlertmanagersFor(orgID int64) []*url.URL
	DroppedAlertmanagersFor(orgID int64) []*url.URL
	// contains filtered or unexported methods
}

ScheduleService handles scheduling

type SchedulerCfg

type SchedulerCfg struct {
	C                       clock.Clock
	BaseInterval            time.Duration
	Logger                  log.Logger
	EvalAppliedFunc         func(models.AlertRuleKey, time.Time)
	MaxAttempts             int64
	StopAppliedFunc         func(models.AlertRuleKey)
	Evaluator               eval.Evaluator
	RuleStore               store.RuleStore
	OrgStore                store.OrgStore
	InstanceStore           store.InstanceStore
	AdminConfigStore        store.AdminConfigurationStore
	MultiOrgNotifier        *notifier.MultiOrgAlertmanager
	Metrics                 *metrics.Scheduler
	AdminConfigPollInterval time.Duration
	DisabledOrgs            map[int64]struct{}
	MinRuleInterval         time.Duration
}

SchedulerCfg is the scheduler configuration.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL