datasource

package
v1.47.0-cluster Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Label added in v1.34.4

type Label struct {
	Name  string
	Value string
}

Label represents metric's label

type Metric added in v1.34.4

type Metric struct {
	Labels    []Label
	Timestamp int64
	Value     float64
}

Metric is the basic entity which should be return by datasource It represents single data point with full list of labels

func (*Metric) AddLabel added in v1.47.0

func (m *Metric) AddLabel(key, value string)

AddLabel appends the given label to the label set

func (*Metric) SetLabel added in v1.47.0

func (m *Metric) SetLabel(key, value string)

SetLabel adds or updates existing one label by the given key and label

type Querier added in v1.34.8

type Querier interface {
	Query(ctx context.Context, query string) ([]Metric, error)
}

Querier interface wraps Query method which executes given query and returns list of Metrics as result

func Init added in v1.37.4

func Init() (Querier, error)

Init creates a Querier from provided flag values.

type VMStorage

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

VMStorage represents vmstorage entity with ability to read and write metrics

func NewVMStorage added in v1.34.4

func NewVMStorage(baseURL, basicAuthUser, basicAuthPass string, lookBack time.Duration, c *http.Client) *VMStorage

NewVMStorage is a constructor for VMStorage

func (*VMStorage) Query

func (s *VMStorage) Query(ctx context.Context, query string) ([]Metric, error)

Query reads metrics from datasource by given query

Jump to

Keyboard shortcuts

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