sli

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

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

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

func (r *Result) AvailabilityRatio() (float64, error)

AvailabilityRatio returns the availability of an SLI result in ratio unit (0-1).

func (*Result) ErrorRatio

func (r *Result) ErrorRatio() (float64, error)

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

func NewMetricsMiddleware(metricssvc metrics.Service, kind string, next Retriever) Retriever

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.

Jump to

Keyboard shortcuts

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