diff --git a/plugins/inputs/cpu/README.md b/plugins/inputs/cpu/README.md index f242c408f..0af7f127d 100644 --- a/plugins/inputs/cpu/README.md +++ b/plugins/inputs/cpu/README.md @@ -36,6 +36,7 @@ See the [CONFIGURATION.md][CONFIGURATION.md] for more details. ## If true, collect raw CPU time metrics collect_cpu_time = false ## If true, compute and report the sum of all non-idle CPU states + ## NOTE: The resulting 'time_active' field INCLUDES 'iowait'! report_active = false ## If true and the info is available then add core_id and physical_id tags core_tags = false diff --git a/plugins/inputs/cpu/cpu.go b/plugins/inputs/cpu/cpu.go index b26a650d3..90cfa2449 100644 --- a/plugins/inputs/cpu/cpu.go +++ b/plugins/inputs/cpu/cpu.go @@ -32,14 +32,6 @@ type CPUStats struct { Log telegraf.Logger `toml:"-"` } -func NewCPUStats(ps system.PS) *CPUStats { - return &CPUStats{ - ps: ps, - CollectCPUTime: true, - ReportActive: true, - } -} - func (*CPUStats) SampleConfig() string { return sampleConfig } diff --git a/plugins/inputs/cpu/cpu_test.go b/plugins/inputs/cpu/cpu_test.go index 62fcd35c1..d91d74ecd 100644 --- a/plugins/inputs/cpu/cpu_test.go +++ b/plugins/inputs/cpu/cpu_test.go @@ -11,6 +11,14 @@ import ( "github.com/influxdata/telegraf/testutil" ) +func NewCPUStats(ps system.PS) *CPUStats { + return &CPUStats{ + ps: ps, + CollectCPUTime: true, + ReportActive: true, + } +} + func TestCPUStats(t *testing.T) { var mps system.MockPS defer mps.AssertExpectations(t) diff --git a/plugins/inputs/cpu/sample.conf b/plugins/inputs/cpu/sample.conf index b0254b95d..9544b2706 100644 --- a/plugins/inputs/cpu/sample.conf +++ b/plugins/inputs/cpu/sample.conf @@ -7,6 +7,7 @@ ## If true, collect raw CPU time metrics collect_cpu_time = false ## If true, compute and report the sum of all non-idle CPU states + ## NOTE: The resulting 'time_active' field INCLUDES 'iowait'! report_active = false ## If true and the info is available then add core_id and physical_id tags core_tags = false