diff --git a/plugins/inputs/cgroup/README.md b/plugins/inputs/cgroup/README.md index a8fd1243e..283b17634 100644 --- a/plugins/inputs/cgroup/README.md +++ b/plugins/inputs/cgroup/README.md @@ -41,7 +41,6 @@ All measurements have the following tags: ``` # [[inputs.cgroup]] - # flush_scope = 10 # optional (the fields will be divided into parts of 10 items) # paths = [ # "/cgroup/memory", # root cgroup # "/cgroup/memory/child1", # container cgroup diff --git a/plugins/inputs/cgroup/cgroup.go b/plugins/inputs/cgroup/cgroup.go index df8f9d915..57ea67a06 100644 --- a/plugins/inputs/cgroup/cgroup.go +++ b/plugins/inputs/cgroup/cgroup.go @@ -18,9 +18,8 @@ import ( const metricName = "cgroup" type CGroup struct { - Paths []string `toml:"paths"` - Files []string `toml:"fields"` - FlushScope int `toml:"flush_scope"` + Paths []string `toml:"paths"` + Files []string `toml:"fields"` } var sampleConfig = ` @@ -83,31 +82,11 @@ func (g *CGroup) gatherDir(dir string, acc telegraf.Accumulator) error { tags := map[string]string{"path": dir} - if g.FlushScope <= 0 { - acc.AddFields(metricName, fields, tags) - return nil - } - writeWithBatches(acc, fields, tags, g.FlushScope) + acc.AddFields(metricName, fields, tags) return nil } -func writeWithBatches(acc telegraf.Accumulator, fields map[string]interface{}, tags map[string]string, scope int) { - for len(fields) > 0 { - batch := make(map[string]interface{}) - - for k, v := range fields { - batch[k] = v - delete(fields, k) - if len(batch) == scope || len(fields) == 0 { - break - } - } - - acc.AddFields(metricName, batch, tags) - } -} - // ====================================================================== type pathInfo struct {