Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
320 changes: 95 additions & 225 deletions plugins/inputs/cpu/cpu_test.go
Original file line number Diff line number Diff line change
@@ -1,249 +1,119 @@
package cpu

import (
"os"
"path/filepath"
"runtime"
"slices"
"testing"

"github.com/shirou/gopsutil/v4/cpu"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/require"

"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/config"
"github.com/influxdata/telegraf/plugins/common/psutil"
"github.com/influxdata/telegraf/plugins/inputs"
"github.com/influxdata/telegraf/plugins/parsers/influx"
"github.com/influxdata/telegraf/testutil"
)

func newCPUStats(ps psutil.PS) *CPU {
return &CPU{
ps: ps,
CollectCPUTime: true,
ReportActive: true,
}
}

func TestCPUStats(t *testing.T) {
var mps psutil.MockPS
defer mps.AssertExpectations(t)
var acc testutil.Accumulator

cts := cpu.TimesStat{
CPU: "cpu0",
User: 8.8,
System: 8.2,
Idle: 80.1,
Nice: 1.3,
Iowait: 0.8389,
Irq: 0.6,
Softirq: 0.11,
Steal: 0.0511,
Guest: 3.1,
GuestNice: 0.324,
}

cts2 := cpu.TimesStat{
CPU: "cpu0",
User: 24.9, // increased by 16.1
System: 10.9, // increased by 2.7
Idle: 157.9798, // increased by 77.8798 (for total increase of 100)
Nice: 3.5, // increased by 2.2
Iowait: 0.929, // increased by 0.0901
Irq: 1.2, // increased by 0.6
Softirq: 0.31, // increased by 0.2
Steal: 0.2812, // increased by 0.2301
Guest: 11.4, // increased by 8.3
GuestNice: 2.524, // increased by 2.2
func TestCases(t *testing.T) {
if runtime.GOOS != "linux" {
t.Skip("CPU usage mocking works on Linux only!")
}

mps.On("CPUTimes").Return([]cpu.TimesStat{cts}, nil)

cs := newCPUStats(&mps)

err := cs.Gather(&acc)
// Get all testcase directories
testcases, err := os.ReadDir("testcases")
require.NoError(t, err)

// Computed values are checked with delta > 0 because of floating point arithmetic
// imprecision
assertContainsTaggedFloat(t, &acc, "time_user", 8.8, 0)
assertContainsTaggedFloat(t, &acc, "time_system", 8.2, 0)
assertContainsTaggedFloat(t, &acc, "time_idle", 80.1, 0)
assertContainsTaggedFloat(t, &acc, "time_active", 19.9, 0.0005)
assertContainsTaggedFloat(t, &acc, "time_nice", 1.3, 0)
assertContainsTaggedFloat(t, &acc, "time_iowait", 0.8389, 0)
assertContainsTaggedFloat(t, &acc, "time_irq", 0.6, 0)
assertContainsTaggedFloat(t, &acc, "time_softirq", 0.11, 0)
assertContainsTaggedFloat(t, &acc, "time_steal", 0.0511, 0)
assertContainsTaggedFloat(t, &acc, "time_guest", 3.1, 0)
assertContainsTaggedFloat(t, &acc, "time_guest_nice", 0.324, 0)

mps2 := psutil.MockPS{}
mps2.On("CPUTimes").Return([]cpu.TimesStat{cts2}, nil)
cs.ps = &mps2

// Should have added cpu percentages too
err = cs.Gather(&acc)
require.NoError(t, err)

assertContainsTaggedFloat(t, &acc, "time_user", 24.9, 0)
assertContainsTaggedFloat(t, &acc, "time_system", 10.9, 0)
assertContainsTaggedFloat(t, &acc, "time_idle", 157.9798, 0)
assertContainsTaggedFloat(t, &acc, "time_active", 42.0202, 0.0005)
assertContainsTaggedFloat(t, &acc, "time_nice", 3.5, 0)
assertContainsTaggedFloat(t, &acc, "time_iowait", 0.929, 0)
assertContainsTaggedFloat(t, &acc, "time_irq", 1.2, 0)
assertContainsTaggedFloat(t, &acc, "time_softirq", 0.31, 0)
assertContainsTaggedFloat(t, &acc, "time_steal", 0.2812, 0)
assertContainsTaggedFloat(t, &acc, "time_guest", 11.4, 0)
assertContainsTaggedFloat(t, &acc, "time_guest_nice", 2.524, 0)

assertContainsTaggedFloat(t, &acc, "usage_user", 7.8, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_system", 2.7, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_idle", 77.8798, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_active", 22.1202, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_nice", 0, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_iowait", 0.0901, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_irq", 0.6, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_softirq", 0.2, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_steal", 0.2301, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_guest", 8.3, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_guest_nice", 2.2, 0.0005)
}

// Asserts that a given accumulator contains a measurement of type float64 with
// specific tags within a certain distance of a given expected value. Asserts a failure
// if the measurement is of the wrong type, or if no matching measurements are found
//
// Parameters:
//
// t *testing.T : Testing object to use
// acc testutil.Accumulator: Accumulator to examine
// field string : Name of field to examine
// expectedValue float64 : Value to search for within the measurement
// delta float64 : Maximum acceptable distance of an accumulated value
// from the expectedValue parameter. Useful when
// floating-point arithmetic imprecision makes looking
// for an exact match impractical
func assertContainsTaggedFloat(
t *testing.T,
acc *testutil.Accumulator,
field string,
expectedValue, delta float64,
) {
var actualValue float64
measurement := "cpu" // always cpu
for _, pt := range acc.Metrics {
if pt.Measurement == measurement {
for fieldname, value := range pt.Fields {
if fieldname == field {
if value, ok := value.(float64); ok {
actualValue = value
if (value >= expectedValue-delta) && (value <= expectedValue+delta) {
// Found the point, return without failing
return
}
} else {
require.Failf(t, "Wrong type", "Measurement %q does not have type float64", measurement)
}
}
}
// Register the plugin
inputs.Add("cpu", func() telegraf.Input {
return &CPU{
PerCPU: true,
TotalCPU: true,
ps: psutil.NewSystemPS(),
}
}
require.Failf(t, "Measurement not found",
"Could not find measurement %q with requested tags within %f of %f, Actual: %f", measurement, delta, expectedValue, actualValue)
}

// TestCPUCountChange tests that no errors are encountered if the number of
// CPUs increases as reported with LXC.
func TestCPUCountIncrease(t *testing.T) {
var mps psutil.MockPS
var mps2 psutil.MockPS
var acc testutil.Accumulator
var err error

cs := newCPUStats(&mps)

mps.On("CPUTimes").Return(
[]cpu.TimesStat{
{
CPU: "cpu0",
},
}, nil)

err = cs.Gather(&acc)
require.NoError(t, err)
})

mps2.On("CPUTimes").Return(
[]cpu.TimesStat{
{
CPU: "cpu0",
},
{
CPU: "cpu1",
},
}, nil)
cs.ps = &mps2

err = cs.Gather(&acc)
require.NoError(t, err)
}

// TestCPUTimesDecrease tests that telegraf continue to works after
// CPU times decrease, which seems to occur when Linux system is suspended.
func TestCPUTimesDecrease(t *testing.T) {
var mps psutil.MockPS
defer mps.AssertExpectations(t)
var acc testutil.Accumulator

cts := cpu.TimesStat{
CPU: "cpu0",
User: 18,
Idle: 80,
Iowait: 2,
}

cts2 := cpu.TimesStat{
CPU: "cpu0",
User: 38, // increased by 20
Idle: 40, // decreased by 40
Iowait: 1, // decreased by 1
// Testing options
opts := []cmp.Option{
testutil.IgnoreTime(),
testutil.IgnoreType(),
testutil.SortMetrics(),
}

cts3 := cpu.TimesStat{
CPU: "cpu0",
User: 56, // increased by 18
Idle: 120, // increased by 80
Iowait: 3, // increased by 2
}

mps.On("CPUTimes").Return([]cpu.TimesStat{cts}, nil)

cs := newCPUStats(&mps)

err := cs.Gather(&acc)
require.NoError(t, err)

// Computed values are checked with delta > 0 because of floating point arithmetic
// imprecision
assertContainsTaggedFloat(t, &acc, "time_user", 18, 0)
assertContainsTaggedFloat(t, &acc, "time_idle", 80, 0)
assertContainsTaggedFloat(t, &acc, "time_iowait", 2, 0)

mps2 := psutil.MockPS{}
mps2.On("CPUTimes").Return([]cpu.TimesStat{cts2}, nil)
cs.ps = &mps2

// CPU times decreased. An error should be raised
err = cs.Gather(&acc)
require.Error(t, err)
for _, testcase := range testcases {
// Only handle folders
if !testcase.IsDir() {
continue
}

mps3 := psutil.MockPS{}
mps3.On("CPUTimes").Return([]cpu.TimesStat{cts3}, nil)
cs.ps = &mps3
t.Run(testcase.Name(), func(t *testing.T) {
testcaseDir := filepath.Join("testcases", testcase.Name())
configFile := filepath.Join(testcaseDir, "telegraf.conf")

// Load plugin from config
conf := config.NewConfig()
require.NoError(t, conf.LoadConfig(configFile))
require.Len(t, conf.Inputs, 1)
plugin, ok := conf.Inputs[0].Input.(*CPU)
require.True(t, ok)

// Create parser for loading the expected metrics
parser := &influx.Parser{}
require.NoError(t, parser.Init())

// Get all steps
matches, err := filepath.Glob(filepath.Join(testcaseDir, "proc*"))
require.NoError(t, err)
slices.Sort(matches)

// Make sure we cleanup the environment
backup := os.Getenv("HOST_PROC")
//nolint:usetesting // We need to reset the environment manually as we reset the environment multiple times
t.Cleanup(func() { os.Setenv("HOST_PROC", backup) })

// Iterate the different counter states and check the results
for _, m := range matches {
proc, err := filepath.Abs(m)
require.NoError(t, err)

// Point processing to mock file
//nolint:usetesting // We manually cleanup the environment as it's unclear whether t.Setenv can handle
// multiple calls within a test or not
os.Setenv("HOST_PROC", proc)

// Read the expected output if any
expectedErrorFilename := filepath.Join(proc, "expected.err")
var expectedError string
if _, err := os.Stat(expectedErrorFilename); err == nil {
expectedErrors, err := testutil.ParseLinesFromFile(expectedErrorFilename)
require.NoError(t, err)
require.Len(t, expectedErrors, 1)
expectedError = expectedErrors[0]
}

err = cs.Gather(&acc)
require.NoError(t, err)
// Load exected metrics
var expected []telegraf.Metric
if expectedError == "" {
expected, err = testutil.ParseMetricsFromFile(filepath.Join(proc, "expected.out"), parser)
require.NoError(t, err)
}

assertContainsTaggedFloat(t, &acc, "time_user", 56, 0)
assertContainsTaggedFloat(t, &acc, "time_idle", 120, 0)
assertContainsTaggedFloat(t, &acc, "time_iowait", 3, 0)
// Gather data and check for error or for the returned metrics
var acc testutil.Accumulator
err = plugin.Gather(&acc)
if expectedError != "" {
require.ErrorContains(t, err, expectedError)
continue
}

assertContainsTaggedFloat(t, &acc, "usage_user", 18, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_idle", 80, 0.0005)
assertContainsTaggedFloat(t, &acc, "usage_iowait", 2, 0.0005)
// Check the outcome in no-error case
require.NoError(t, err)
t.Logf("checking %q", m)
testutil.RequireMetricsEqual(t, expected, acc.GetTelegrafMetrics(), opts...)
}
})
}
}
1 change: 1 addition & 0 deletions plugins/inputs/cpu/testcases/counters/proc/expected.out
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
cpu,cpu=cpu-total time_guest=0,time_guest_nice=0,time_idle=153423.53,time_iowait=67.31,time_irq=159.58,time_nice=0.3,time_softirq=36.21,time_steal=0,time_system=360.48,time_user=1106.86 1784292599146890138
24 changes: 24 additions & 0 deletions plugins/inputs/cpu/testcases/counters/proc/stat
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
cpu 110686 30 36048 15342353 6731 15958 3621 0 0 0
cpu0 5006 0 2060 960064 467 741 1220 0 0 0
cpu1 18428 4 5470 942378 830 1224 416 0 0 0
cpu2 17820 10 4259 944457 943 1216 289 0 0 0
cpu3 7942 0 3004 956117 635 1180 513 0 0 0
cpu4 1955 0 525 967247 127 185 64 0 0 0
cpu5 2145 0 1041 966329 207 264 69 0 0 0
cpu6 2650 0 1425 965279 289 285 79 0 0 0
cpu7 1764 0 566 967413 197 199 52 0 0 0
cpu8 5151 0 1877 961476 423 654 109 0 0 0
cpu9 15653 13 6061 945775 644 878 179 0 0 0
cpu10 18587 0 4112 938088 642 7565 197 0 0 0
cpu11 6396 0 2672 958675 585 896 278 0 0 0
cpu12 1437 0 461 967933 188 160 30 0 0 0
cpu13 1871 0 838 967145 144 161 36 0 0 0
cpu14 2195 0 1229 966266 198 195 47 0 0 0
cpu15 1678 0 440 967703 204 149 35 0 0 0
intr 20906479 137 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 73 0 1 1 1 1 0 1 0 1 0 1 0 0 75 2293 0 0 0 0 0 0 0 0 194491 0 0 0 0 0 0 0 0 127 126 30931 25097 23368 23289 13177 15355 14638 14865 16237 15868 15531 15929 30489 26183 21121 22437 143 424 457 171 34 31 223 88 435 30 51 73 1713 216 116 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 195425 921067 207 218639 267 0 30784 2839132 5 782701
3 changes: 3 additions & 0 deletions plugins/inputs/cpu/testcases/counters/telegraf.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[inputs.cpu]]
collect_cpu_time = true
percpu = false
Empty file.
10 changes: 10 additions & 0 deletions plugins/inputs/cpu/testcases/cpu_count_decrease/proc0/stat
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cpu 110686 30 36048 15342353 6731 15958 3621 0 0 0
cpu0 5006 0 2060 960064 467 741 1220 0 0 0
cpu1 18428 4 5470 942378 830 1224 416 0 0 0
intr 20906479 137 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 73 0 1 1 1 1 0 1 0 1 0 1 0 0 75 2293 0 0 0 0 0 0 0 0 194491 0 0 0 0 0 0 0 0 127 126 30931 25097 23368 23289 13177 15355 14638 14865 16237 15868 15531 15929 30489 26183 21121 22437 143 424 457 171 34 31 223 88 435 30 51 73 1713 216 116 92 0 0 0 0 707 0 0 842993 0 129196 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 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0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
ctxt 28964860
btime 1784274102
processes 6861
procs_running 2
procs_blocked 1
softirq 4988227 195425 921067 207 218639 267 0 30784 2839132 5 782701
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cpu,cpu=cpu0 usage_guest=0,usage_guest_nice=0,usage_idle=98.99208959203628,usage_iowait=0.03393637737251638,usage_irq=0.10245553930559709,usage_nice=0,usage_softirq=0.14027035980640107,usage_steal=0,usage_system=0.3120530700301387,usage_user=0.41919506144908336 1784293055014711043
cpu,cpu=cpu-total usage_guest=0,usage_guest_nice=0,usage_idle=98.79324440645692,usage_iowait=0.0320620665057134,usage_irq=0.13419615804548835,usage_nice=0.000010098288663216828,usage_softirq=0.0386057575594779,usage_steal=0,usage_system=0.40175031617741797,usage_user=0.6001311969663126 1784293055014711043
Loading
Loading