2022-05-24 21:49:47 +08:00
|
|
|
//go:generate ../../../tools/readme_config_includer/generator
|
2016-06-08 16:13:22 +08:00
|
|
|
package cgroup
|
|
|
|
|
|
|
|
|
|
import (
|
2022-05-24 21:49:47 +08:00
|
|
|
_ "embed"
|
|
|
|
|
|
2016-06-08 16:13:22 +08:00
|
|
|
"github.com/influxdata/telegraf"
|
|
|
|
|
"github.com/influxdata/telegraf/plugins/inputs"
|
|
|
|
|
)
|
|
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
//go:embed sample.conf
|
|
|
|
|
var sampleConfig string
|
|
|
|
|
|
2016-06-08 16:13:22 +08:00
|
|
|
type CGroup struct {
|
2016-06-23 16:11:44 +08:00
|
|
|
Paths []string `toml:"paths"`
|
2016-06-23 17:23:31 +08:00
|
|
|
Files []string `toml:"files"`
|
2022-12-07 22:21:59 +08:00
|
|
|
|
|
|
|
|
logged map[string]bool
|
2016-06-08 16:13:22 +08:00
|
|
|
}
|
|
|
|
|
|
2022-05-24 21:49:47 +08:00
|
|
|
func (*CGroup) SampleConfig() string {
|
|
|
|
|
return sampleConfig
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-07 22:21:59 +08:00
|
|
|
func (cg *CGroup) Init() error {
|
|
|
|
|
cg.logged = make(map[string]bool)
|
|
|
|
|
|
|
|
|
|
return nil
|
|
|
|
|
}
|
|
|
|
|
|
2016-06-08 16:13:22 +08:00
|
|
|
func init() {
|
|
|
|
|
inputs.Add("cgroup", func() telegraf.Input { return &CGroup{} })
|
|
|
|
|
}
|