Include CPU usage percent with procstat data

closes #484
This commit is contained in:
Cameron Sparr
2016-01-19 17:28:02 -07:00
parent d3a5cca1bc
commit d3925fe578
4 changed files with 39 additions and 33 deletions

View File

@@ -6,6 +6,7 @@ import (
"strconv"
"testing"
"github.com/shirou/gopsutil/process"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
@@ -23,6 +24,7 @@ func TestGather(t *testing.T) {
p := Procstat{
PidFile: file.Name(),
Prefix: "foo",
pidmap: make(map[int32]*process.Process),
}
p.Gather(&acc)
assert.True(t, acc.HasFloatField("procstat", "foo_cpu_time_user"))