-
Notifications
You must be signed in to change notification settings - Fork 88
/
command_linux.go
47 lines (39 loc) · 1.32 KB
/
command_linux.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package command
import (
"github.com/mackerelio/mackerel-agent/config"
"github.com/mackerelio/mackerel-agent/metrics"
metricsLinux "github.com/mackerelio/mackerel-agent/metrics/linux"
"github.com/mackerelio/mackerel-agent/spec"
specLinux "github.com/mackerelio/mackerel-agent/spec/linux"
)
func specGenerators() []spec.Generator {
return []spec.Generator{
&specLinux.KernelGenerator{},
&specLinux.CPUGenerator{},
&specLinux.MemoryGenerator{},
&specLinux.BlockDeviceGenerator{},
&specLinux.FilesystemGenerator{},
}
}
func interfaceGenerator() spec.Generator {
return &specLinux.InterfaceGenerator{}
}
func metricsGenerators(conf *config.Config) []metrics.Generator {
generators := []metrics.Generator{
&metricsLinux.Loadavg5Generator{},
&metricsLinux.CPUUsageGenerator{Interval: metricsInterval},
&metricsLinux.MemoryGenerator{},
&metricsLinux.UptimeGenerator{},
&metricsLinux.InterfaceGenerator{Interval: metricsInterval},
&metricsLinux.DiskGenerator{Interval: metricsInterval},
&metricsLinux.FilesystemGenerator{},
}
return generators
}
func pluginGenerators(conf *config.Config) []metrics.PluginGenerator {
generators := []metrics.PluginGenerator{}
for _, pluginConfig := range conf.Plugin["metrics"] {
generators = append(generators, metrics.NewPluginGenerator(pluginConfig))
}
return generators
}