promapi

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 26, 2021 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 PrometheusConfig

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

func Config

func Config(uri string, timeout time.Duration) (*PrometheusConfig, error)

type QueryResult

type QueryResult struct {
	Series          model.Vector
	DurationSeconds float64
}

func Query

func Query(uri string, timeout time.Duration, expr string, lockKey *string) (*QueryResult, error)

type RangeQueryResult

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

func RangeQuery

func RangeQuery(uri string, timeout time.Duration, expr string, start, end time.Time, step time.Duration, lockKey *string) (*RangeQueryResult, error)

Jump to

Keyboard shortcuts

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