docs(inputs.cpu): Clarify 'time_active' contains 'iowait' (#14215)

This commit is contained in:
Sven Rebhan 2023-10-31 13:20:44 +01:00 committed by GitHub
parent 42cd671963
commit debae8ead0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 8 deletions

View File

@ -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

View File

@ -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
}

View File

@ -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)

View File

@ -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