2016-06-08 08:13:22 +00:00
|
|
|
package cgroup
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/influxdata/telegraf"
|
|
|
|
"github.com/influxdata/telegraf/plugins/inputs"
|
|
|
|
)
|
|
|
|
|
|
|
|
type CGroup struct {
|
2016-06-23 08:11:44 +00:00
|
|
|
Paths []string `toml:"paths"`
|
2016-06-23 09:23:31 +00:00
|
|
|
Files []string `toml:"files"`
|
2016-06-08 08:13:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
var sampleConfig = `
|
2016-06-23 09:23:31 +00:00
|
|
|
## Directories in which to look for files, globs are supported.
|
2016-06-08 08:13:22 +00:00
|
|
|
# paths = [
|
|
|
|
# "/cgroup/memory",
|
|
|
|
# "/cgroup/memory/child1",
|
|
|
|
# "/cgroup/memory/child2/*",
|
|
|
|
# ]
|
2016-06-23 09:23:31 +00:00
|
|
|
## cgroup stat fields, as file names, globs are supported.
|
|
|
|
## these file names are appended to each path from above.
|
|
|
|
# files = ["memory.*usage*", "memory.limit_in_bytes"]
|
2016-06-08 08:13:22 +00:00
|
|
|
`
|
|
|
|
|
|
|
|
func (g *CGroup) SampleConfig() string {
|
|
|
|
return sampleConfig
|
|
|
|
}
|
|
|
|
|
|
|
|
func (g *CGroup) Description() string {
|
|
|
|
return "Read specific statistics per cgroup"
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
inputs.Add("cgroup", func() telegraf.Input { return &CGroup{} })
|
|
|
|
}
|