metrics

package
v0.0.0-...-80afc61 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// spaces can't individually demarcate individual lexical units
	// in promql.
	PromQLTokenSeparators = " []{}()=!~,"
)

Variables

This section is empty.

Functions

func PromResultToPromSeriesSet

func PromResultToPromSeriesSet(res *promql.Result) (plot.SeriesSet, error)

PromResultToPromSeriesSet copies res and converts it to a format suitable for use with the terminal plotting library. It copies since query results are generally not usable beyond the lifetime of the query.

Types

type Completer

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

func NewCompleter

func NewCompleter(completor autocomplete.PromQLCompleter) *Completer

func (*Completer) Complete

func (c *Completer) Complete(d prompt.Document) []prompt.Suggest

type DataSources

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

func (DataSources) ScrapePrometheusEndpoint

func (d DataSources) ScrapePrometheusEndpoint(ctx context.Context, ts time.Time) ([]prom.ParsedSeries, error)

type MetricsCommand

type MetricsCommand struct {
	cli.PromQCommand
	Period time.Duration
	Window time.Duration
	// contains filtered or unexported fields
}

func (*MetricsCommand) Run

func (c *MetricsCommand) Run(flags cli.PromQFlags) error

type PromPoint

type PromPoint promql.Point

func (PromPoint) X

func (p PromPoint) X() int64

func (PromPoint) Y

func (p PromPoint) Y() float64

type PromSeries

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

func (*PromSeries) Id

func (s *PromSeries) Id() plot.SeriesId

func (*PromSeries) Points

func (s *PromSeries) Points() []plot.Point

func (*PromSeries) Title

func (s *PromSeries) Title() string

type PromSeriesSet

type PromSeriesSet promql.Matrix

TODO(sollyross): can we make this more efficient with prometheus return data? do we need to?

Jump to

Keyboard shortcuts

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