Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockRetrieverFactory ¶
type MockRetrieverFactory struct {
Mock Retriever
}
MockRetrieverFactory returns the mocked retriever strategy.
func (MockRetrieverFactory) GetStrategy ¶
func (m MockRetrieverFactory) GetStrategy(_ *monitoringv1alpha1.SLI) (Retriever, error)
GetStrategy satisfies RetrieverFactory interface.
type Result ¶
type Result struct { // TotalQ is the result of applying the total query. TotalQ float64 // ErrorQ is the result of applying the error query. ErrorQ float64 }
Result is the result of getting a SLI from a backend.
func (*Result) AvailabilityRatio ¶
AvailabilityRatio returns the availability of an SLI result in ratio unit (0-1).
func (*Result) ErrorRatio ¶
ErrorRatio returns the error of an SLI result in. ratio unit (0-1).
type Retriever ¶
type Retriever interface { // Retrieve returns the result of a SLI retrieved from the implemented backend. Retrieve(*monitoringv1alpha1.SLI) (Result, error) }
Retriever knows how to get SLIs from different backends.
func NewMetricsMiddleware ¶
NewMetricsMiddleware returns a new metrics middleware that wraps a Retriever SLI service and monitorings with metrics.
func NewPrometheus ¶
func NewPrometheus(promCliFactory promcli.ClientFactory, logger log.Logger) Retriever
NewPrometheus returns a new prometheus SLI service.
type RetrieverFactory ¶
type RetrieverFactory interface { // GetRetriever returns a retriever based on the SLI source. GetStrategy(*monitoringv1alpha1.SLI) (Retriever, error) }
RetrieverFactory is a factory that knows how to get the correct Retriever based on the SLI source.
func NewRetrieverFactory ¶
func NewRetrieverFactory(promRetriever Retriever) RetrieverFactory
NewRetrieverFactory returns a new retriever factory.