From 1e5b0e64ac6dc38ab108f56e05c01ca8862e1841 Mon Sep 17 00:00:00 2001 From: George Robinson Date: Thu, 25 Nov 2021 10:12:04 +0000 Subject: [PATCH] Alerting: Add comments to ScheduleService interface (#42228) --- pkg/services/ngalert/schedule/schedule.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pkg/services/ngalert/schedule/schedule.go b/pkg/services/ngalert/schedule/schedule.go index e6cc980f0f6..4acad845a0e 100644 --- a/pkg/services/ngalert/schedule/schedule.go +++ b/pkg/services/ngalert/schedule/schedule.go @@ -23,12 +23,21 @@ import ( "golang.org/x/sync/errgroup" ) -// ScheduleService handles scheduling +// ScheduleService is an interface for a service that schedules the evaluation +// of alert rules. 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 Pause() error Unpause() error + + // AlertmanagersFor returns all the discovered Alertmanager URLs for the + // organization. AlertmanagersFor(orgID int64) []*url.URL + + // DroppedAlertmanagersFor returns all the dropped Alertmanager URLs for the + // organization. DroppedAlertmanagersFor(orgID int64) []*url.URL // the following are used by tests only used for tests