providers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientAuth

type ClientAuth struct {
	Username    string
	BearerToken string
	Password    string
}

ClientAuth holds the HTTP client identity info.

func (*ClientAuth) Apply

func (auth *ClientAuth) Apply(req *http.Request)

Apply applies the authentication identity info to the HTTP request headers

type Interface

type Interface interface {
	// GetTimeSeries returns the metric time series that meet the given
	// conditions from the specified time range.
	GetTimeSeries(metricName string, Conditions []common.QueryCondition,
		startTime time.Time, endTime time.Time, step time.Duration) ([]*common.TimeSeries, error)

	// GetLatestTimeSeries returns the latest metric values that meet the given conditions.
	GetLatestTimeSeries(metricName string, Conditions []common.QueryCondition) ([]*common.TimeSeries, error)

	// QueryTimeSeries returns the time series based on a promql like query string.
	QueryTimeSeries(queryExpr string, startTime time.Time, endTime time.Time, step time.Duration) ([]*common.TimeSeries, error)

	// QueryLatestTimeSeries returns the latest metric values that meet the given query.
	QueryLatestTimeSeries(queryExpr string) ([]*common.TimeSeries, error)
}

Interface is a source of monitoring metric that provides metrics that can be used for prediction, such as 'cpu usage', 'memory footprint', 'request per second (qps)', etc.

type MockConfig

type MockConfig struct {
	SeedFile string
}

MockConfig represents the config of an in-memory provider, which is for demonstration or testing purpose.

type PromConfig

type PromConfig struct {
	Address            string
	Timeout            time.Duration
	KeepAlive          time.Duration
	InsecureSkipVerify bool
	Auth               ClientAuth

	QueryConcurrency int
	BRateLimit       bool
}

PromConfig represents the config of prometheus

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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