prometheus

package
v0.0.0-...-2251682 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2018 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Devops

type Devops struct {
	*devops.Core
}

Devops produces Influx-specific queries for all the devops query types.

func NewDevops

func NewDevops(start, end time.Time, scale int) *Devops

NewDevops makes an Devops object ready to generate Queries.

func (*Devops) GenerateEmptyQuery

func (d *Devops) GenerateEmptyQuery() query.Query

GenerateEmptyQuery returns an empty query.HTTP

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' for nhosts hosts, e.g.: max(max_over_time({__name__=~"metric1|metric2...|metricN",hostname=~"hostname1|hostname2...|hostnameN"})) 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 psuedo-SQL:

avg(avg_over_time({__name__=~"metric1|metric2...|metricN"})) by (__name__, hostname)

func (*Devops) HighCPUForHosts

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

HighCPUForHosts populates a query that gets CPU metrics when the CPU has high usage between a time period for a number of hosts (if 0, it will search all hosts), e.g.:

max(max_over_time(cpu_usage_user{hostname=~"hostname1|hostname2...|hostnameN"})) by (hostname) > 90

func (*Devops) MaxAllCPU

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

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

max(max_over_time({hostname=~"hostname1|hostname2...|hostnameN"}))

Jump to

Keyboard shortcuts

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