parent
2cf5685519
commit
3fcadc3e09
|
@ -65,7 +65,7 @@ func (p *Processes) Gather(acc telegraf.Accumulator) error {
|
||||||
func getEmptyFields() map[string]interface{} {
|
func getEmptyFields() map[string]interface{} {
|
||||||
fields := map[string]interface{}{
|
fields := map[string]interface{}{
|
||||||
"blocked": int64(0),
|
"blocked": int64(0),
|
||||||
"zombie": int64(0),
|
"zombies": int64(0),
|
||||||
"stopped": int64(0),
|
"stopped": int64(0),
|
||||||
"running": int64(0),
|
"running": int64(0),
|
||||||
"sleeping": int64(0),
|
"sleeping": int64(0),
|
||||||
|
@ -105,7 +105,7 @@ func (p *Processes) gatherFromPS(fields map[string]interface{}) error {
|
||||||
// Also known as uninterruptible sleep or disk sleep
|
// Also known as uninterruptible sleep or disk sleep
|
||||||
fields["blocked"] = fields["blocked"].(int64) + int64(1)
|
fields["blocked"] = fields["blocked"].(int64) + int64(1)
|
||||||
case 'Z':
|
case 'Z':
|
||||||
fields["zombie"] = fields["zombie"].(int64) + int64(1)
|
fields["zombies"] = fields["zombies"].(int64) + int64(1)
|
||||||
case 'T':
|
case 'T':
|
||||||
fields["stopped"] = fields["stopped"].(int64) + int64(1)
|
fields["stopped"] = fields["stopped"].(int64) + int64(1)
|
||||||
case 'R':
|
case 'R':
|
||||||
|
|
|
@ -40,10 +40,11 @@ func TestFromPS(t *testing.T) {
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
|
|
||||||
fields := getEmptyFields()
|
fields := getEmptyFields()
|
||||||
fields["blocked"] = int64(1)
|
fields["blocked"] = int64(4)
|
||||||
|
fields["zombies"] = int64(1)
|
||||||
fields["running"] = int64(4)
|
fields["running"] = int64(4)
|
||||||
fields["sleeping"] = int64(34)
|
fields["sleeping"] = int64(34)
|
||||||
fields["total"] = int64(39)
|
fields["total"] = int64(43)
|
||||||
|
|
||||||
acc.AssertContainsTaggedFields(t, "processes", fields, map[string]string{})
|
acc.AssertContainsTaggedFields(t, "processes", fields, map[string]string{})
|
||||||
}
|
}
|
||||||
|
@ -139,6 +140,10 @@ S
|
||||||
S+
|
S+
|
||||||
S+
|
S+
|
||||||
Ss
|
Ss
|
||||||
|
L
|
||||||
|
U
|
||||||
|
Z
|
||||||
|
D
|
||||||
S+
|
S+
|
||||||
`
|
`
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue