promapi

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HumanizeBytes

func HumanizeBytes(b int) string

func HumanizeDuration

func HumanizeDuration(d time.Duration) string

Types

type ConfigSectionGlobal

type ConfigSectionGlobal struct {
	ScrapeInterval     time.Duration     `yaml:"scrape_interval"`
	ScrapeTimeout      time.Duration     `yaml:"scrape_timeout"`
	EvaluationInterval time.Duration     `yaml:"evaluation_interval"`
	ExternalLabels     map[string]string `yaml:"external_labels"`
}

type Prometheus added in v0.7.0

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

func NewPrometheus added in v0.7.0

func NewPrometheus(name, uri string, timeout time.Duration) *Prometheus

func (*Prometheus) ClearCache added in v0.7.0

func (p *Prometheus) ClearCache()

func (*Prometheus) Config added in v0.7.0

func (p *Prometheus) Config(ctx context.Context) (*PrometheusConfig, error)

func (*Prometheus) Name added in v0.7.0

func (p *Prometheus) Name() string

func (*Prometheus) Query added in v0.7.0

func (p *Prometheus) Query(ctx context.Context, expr string) (*QueryResult, error)

func (*Prometheus) RangeQuery added in v0.7.0

func (p *Prometheus) RangeQuery(ctx context.Context, expr string, start, end time.Time, step time.Duration) (*RangeQueryResult, error)

type PrometheusConfig

type PrometheusConfig struct {
	Global ConfigSectionGlobal `yaml:"global"`
}

type QueryResult

type QueryResult struct {
	Series          model.Vector
	DurationSeconds float64
}

type RangeQueryResult

type RangeQueryResult struct {
	Samples         []*model.SampleStream
	Start           time.Time
	End             time.Time
	DurationSeconds float64
}

Jump to

Keyboard shortcuts

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