2023-01-05 12:21:07 -06:00
|
|
|
package historian
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
|
|
|
"github.com/grafana/grafana/pkg/services/ngalert/state"
|
2023-01-25 11:29:57 -06:00
|
|
|
history_model "github.com/grafana/grafana/pkg/services/ngalert/state/historian/model"
|
2023-01-05 12:21:07 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
// NoOpHistorian is a state.Historian that does nothing with the resulting data, to be used in contexts where history is not needed.
|
|
|
|
type NoOpHistorian struct{}
|
|
|
|
|
|
|
|
func NewNopHistorian() *NoOpHistorian {
|
|
|
|
return &NoOpHistorian{}
|
|
|
|
}
|
|
|
|
|
2023-01-25 11:29:57 -06:00
|
|
|
func (f *NoOpHistorian) RecordStatesAsync(ctx context.Context, _ history_model.RuleMeta, _ []state.StateTransition) <-chan error {
|
2023-01-24 09:41:38 -06:00
|
|
|
errCh := make(chan error)
|
|
|
|
close(errCh)
|
|
|
|
return errCh
|
2023-01-05 12:21:07 -06:00
|
|
|
}
|