//
// arvados-server crunchstat -dump ./testdata/example1234 sleep 2
var testdata = map[string]testdatasource{
+ "debian10": {fspath: "testdata/debian10", pid: 3288},
"debian11": {fspath: "testdata/debian11", pid: 4153022},
"debian12": {fspath: "testdata/debian12", pid: 1115883},
"ubuntu1804": {fspath: "testdata/ubuntu1804", pid: 2523},
`(?ms).*rss.*`,
`(?ms).*net:.*`,
`(?ms).*blkio:.*`,
- `(?ms).* [\d.]+ user [\d.]+ sys ` + fmt.Sprintf("%d", runtime.NumCPU()) + ` cpus -- .*`,
+ `(?ms).* [\d.]+ user [\d.]+ sys ` + fmt.Sprintf("%.2f", float64(runtime.NumCPU())) + ` cpus -- .*`,
}
for deadline := time.Now().Add(4 * time.Second); !c.Failed(); time.Sleep(time.Millisecond) {
done := true
c.Check(logs, Matches, `(?ms).* \d\d+ rss\\n.*`)
c.Check(logs, Matches, `(?ms).*blkio:\d+:\d+ \d+ write \d+ read\\n.*`)
c.Check(logs, Matches, `(?ms).*net:\S+ \d+ tx \d+ rx\\n.*`)
- c.Check(logs, Matches, `(?ms).* [\d.]+ user [\d.]+ sys [2-9]\d* cpus.*`)
+ c.Check(logs, Matches, `(?ms).* [\d.]+ user [\d.]+ sys [2-9]\d*\.\d\d cpus.*`)
}
}