Add processes status stats in system input plugin
This commit is contained in:
committed by
Michele Fadda
parent
3d3b93d693
commit
ca3df67156
21
plugins/inputs/system/processes_test.go
Normal file
21
plugins/inputs/system/processes_test.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package system
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/influxdata/telegraf/testutil"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestProcesses(t *testing.T) {
|
||||
processes := &Processes{}
|
||||
var acc testutil.Accumulator
|
||||
|
||||
err := processes.Gather(&acc)
|
||||
require.NoError(t, err)
|
||||
|
||||
assert.True(t, acc.HasUIntField("processes", "running"))
|
||||
assert.True(t, acc.HasUIntField("processes", "sleeping"))
|
||||
assert.True(t, acc.HasUIntField("processes", "stopped"))
|
||||
}
|
||||
Reference in New Issue
Block a user