prediction

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Index

Constants

View Source
const (
	HistoryProvider  = "__history"
	RealtimeProvider = "__realtime"
)

Variables

This section is empty.

Functions

func AggregateSignalKey

func AggregateSignalKey(id string, labels []common.Label) string

Types

type GenericPrediction

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

func NewGenericPrediction

func NewGenericPrediction(withQueryBroadcaster config.Broadcaster) GenericPrediction

func (*GenericPrediction) GetHistoryProvider

func (p *GenericPrediction) GetHistoryProvider() providers.Interface

func (*GenericPrediction) GetRealtimeProvider

func (p *GenericPrediction) GetRealtimeProvider() providers.Interface

func (*GenericPrediction) WithProviders

func (p *GenericPrediction) WithProviders(providers map[string]providers.Interface)

func (*GenericPrediction) WithQuery

func (p *GenericPrediction) WithQuery(query string) error

type Interface

type Interface interface {
	// Run performs the prediction routine.
	Run(stopCh <-chan struct{})

	// WithProviders registers providers from which metrics data come from
	WithProviders(map[string]providers.Interface)

	// WithQuery registers a PromQL like query expression, so that the prediction will involve the time series that
	// are selected and aggregated through the specified 'queryExpr'.
	WithQuery(queryExpr string) error

	// QueryRealtimePredictedValues returns predicted values based on the specified query expression
	QueryRealtimePredictedValues(queryExpr string) ([]*common.TimeSeries, error)

	// QueryPredictedTimeSeries returns predicted time series based on the specified query expression
	QueryPredictedTimeSeries(queryExpr string, startTime time.Time, endTime time.Time) ([]*common.TimeSeries, error)

	Name() string
}

type WithMetricEvent

type WithMetricEvent struct {
	MetricName string
	Conditions []common.QueryCondition
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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