victoriametrics

package
v0.0.0-...-37fced7 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 9 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseGenerator

type BaseGenerator struct{}

func (*BaseGenerator) GenerateEmptyQuery

func (g *BaseGenerator) GenerateEmptyQuery() query.Query

GenerateEmptyQuery returns an empty query.HTTP.

func (*BaseGenerator) NewDevops

func (g *BaseGenerator) NewDevops(start, end time.Time, scale int) (utils.QueryGenerator, error)

NewDevops creates a new devops use case query generator.

type Devops

type Devops struct {
	*BaseGenerator
	*devops.Core
}

Devops produces PromQL queries for all the devops query types.

func (*Devops) GroupByOrderByLimit

func (d *Devops) GroupByOrderByLimit(qi query.Query)

func (*Devops) GroupByTime

func (d *Devops) GroupByTime(qq query.Query, nHosts, numMetrics int, timeRange time.Duration)

GroupByTime selects the MAX for numMetrics metrics under 'cpu' per minute for nhosts hosts, e.g. in pseudo-PromQL: max(

max_over_time(
	{__name__=~"metric1|metric2...|metricN",hostname=~"hostname1|hostname2...|hostnameN"}[1m]
)

) by (__name__)

func (*Devops) GroupByTimeAndPrimaryTag

func (d *Devops) GroupByTimeAndPrimaryTag(qq query.Query, numMetrics int)

GroupByTimeAndPrimaryTag selects the AVG of numMetrics metrics under 'cpu' per device per hour for a day, e.g. in pseudo-PromQL:

avg(

avg_over_time(
	{__name__=~"metric1|metric2...|metricN"}[1h]
)

) by (__name__, hostname)

Resultsets: double-groupby-1 double-groupby-5 double-groupby-all

func (*Devops) HighCPUForHosts

func (d *Devops) HighCPUForHosts(qi query.Query, nHosts int)

func (*Devops) LastPointPerHost

func (d *Devops) LastPointPerHost(qq query.Query)

func (*Devops) MaxAllCPU

func (d *Devops) MaxAllCPU(qq query.Query, nHosts int, duration time.Duration)

MaxAllCPU selects the MAX of all metrics under 'cpu' per hour for nhosts hosts, e.g. in pseudo-PromQL:

max(

max_over_time(
	{hostname=~"hostname1|hostname2...|hostnameN"}[1h]
)

) by (__name__)

Jump to

Keyboard shortcuts

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