Documentation ¶
Index ¶
- type BaseGenerator
- type Devops
- func (d *Devops) GenerateEmptyQuery() query.Query
- func (d *Devops) GroupByTime(qi query.Query, nhosts, numMetrics int, timeRange time.Duration)
- func (d *Devops) GroupByTimeAndPrimaryTag(qi query.Query, numMetrics int)
- func (d *Devops) HighCPUForHosts(qi query.Query, nHosts int)
- func (d *Devops) LastPointPerHost(qi query.Query)
- func (d *Devops) MaxAllCPU(qi query.Query, nHosts int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseGenerator ¶
type BaseGenerator struct { }
BaseGenerator contains settings specific for Akumuli database.
func (*BaseGenerator) NewDevops ¶
func (g *BaseGenerator) NewDevops(start, end time.Time, scale int) (utils.QueryGenerator, error)
NewDevops makes an Devops object ready to generate Queries.
type Devops ¶
type Devops struct { *BaseGenerator *devops.Core }
Devops produces Influx-specific queries for all the devops query types.
func (*Devops) GenerateEmptyQuery ¶
GenerateEmptyQuery returns an empty query.HTTP
func (*Devops) GroupByTime ¶
GroupByTime selects the MAX for a single metric under 'cpu', per minute for nhosts hosts, e.g. in pseudo-SQL:
SELECT minute, max(metric1), ..., max(metricN) FROM cpu WHERE
(hostname = '$HOSTNAME_1' OR ... OR hostname = '$HOSTNAME_N') AND time >= '$HOUR_START' AND time < '$HOUR_END'
GROUP BY minute ORDER BY minute ASC
Resultsets: single-groupby-1-1-12 single-groupby-1-1-1 single-groupby-1-8-1 single-groupby-5-1-12 single-groupby-5-1-1 single-groupby-5-8-1
func (*Devops) GroupByTimeAndPrimaryTag ¶
GroupByTimeAndPrimaryTag selects the AVG of numMetrics metrics under 'cpu' per device per hour for a day, e.g. in pseudo-SQL:
SELECT AVG(metric1), ..., AVG(metricN) FROM cpu WHERE time >= '$HOUR_START' AND time < '$HOUR_END' GROUP BY hour, hostname ORDER BY hour, hostname
Resultsets: double-groupby-1 double-groupby-5 double-groupby-all
func (*Devops) HighCPUForHosts ¶
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. in pseudo-SQL:
SELECT * FROM cpu WHERE usage_user > 90.0 AND time >= '$TIME_START' AND time < '$TIME_END' AND (hostname = '$HOST' OR hostname = '$HOST2'...)
Resultsets: high-cpu-1 high-cpu-all
func (*Devops) LastPointPerHost ¶
LastPointPerHost finds the last row for every host in the dataset
func (*Devops) MaxAllCPU ¶
MaxAllCPU selects the MAX of all metrics under 'cpu' per hour for nhosts hosts, e.g. in pseudo-SQL:
SELECT MAX(metric1), ..., MAX(metricN) FROM cpu WHERE
(hostname = '$HOSTNAME_1' OR ... OR hostname = '$HOSTNAME_N') AND time >= '$HOUR_START' AND time < '$HOUR_END'
GROUP BY hour ORDER BY hour
Resultsets: cpu-max-all-1 cpu-max-all-8