forked from gregorynoma/tsbs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
high_cpu.go
33 lines (29 loc) · 799 Bytes
/
high_cpu.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
package devops
import (
"github.com/timescale/tsbs/cmd/tsbs_generate_queries/uses/common"
"github.com/timescale/tsbs/cmd/tsbs_generate_queries/utils"
"github.com/timescale/tsbs/pkg/query"
)
// HighCPU produces a QueryFiller for the devops high-cpu cases
type HighCPU struct {
core utils.QueryGenerator
hosts int
}
// NewHighCPU produces a new function that produces a new HighCPU
func NewHighCPU(hosts int) utils.QueryFillerMaker {
return func(core utils.QueryGenerator) utils.QueryFiller {
return &HighCPU{
core: core,
hosts: hosts,
}
}
}
// Fill fills in the query.Query with query details
func (d *HighCPU) Fill(q query.Query) query.Query {
fc, ok := d.core.(HighCPUFiller)
if !ok {
common.PanicUnimplementedQuery(d.core)
}
fc.HighCPUForHosts(q, d.hosts)
return q
}