sources

package
v0.0.0-...-ac2ef88 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Prometheus

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

func NewPrometheus

func NewPrometheus(address string) (p *Prometheus, err error)

func (*Prometheus) PreciseQuery

func (p *Prometheus) PreciseQuery(query string, start time.Time, end time.Time) (val model.Value, err error)

func (*Prometheus) Query

func (p *Prometheus) Query(query string, start time.Time, end time.Time, step time.Duration) (model.Value, error)

type Source

type Source interface {

	// A data source may not implemented this method
	Query(query string, start time.Time, end time.Time, step time.Duration) (model.Value, error)

	// A data source must implemented this method
	//   for a non-prometheus data source, it could consider the 'query' as 'name'
	PreciseQuery(query string, start time.Time, end time.Time) (model.Value, error)
}

We support data source types other than prometheus,

but thay need to convert into prometheus-format

type Sources

type Sources map[string]Source

Jump to

Keyboard shortcuts

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