elastic / elastic/apm-agent-nodejs
system.process.cpu.user.norm.pct can be larger than 1 on Windows
- Dominant language
- JavaScript
- Stars
- 594
- Forks
- 244
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 16
Description
The `system.process.cpu.user.norm.pct` metric (and therefore also `system.process.cpu.total.norm.pct`) can be larger than 1 on Windows.
From a [recent AppVeyor build](https://ci.appveyor.com/project/watson/apm-agent-nodejs/builds/25822973#L2631) during "event 1":
```
# system.process.cpu.total.norm.pct
ok 39 is present
ok 40 is a number
ok 41 is finite (was: 1.4355878313710884)
not ok 42 is betewen 0 and 1
---
operator: ok
expected: true
actual: false
at: Object.metrics.system.process.cpu.total.norm.pct (C:\projects\apm-agent-nodejs\test\metrics\index.js:109:13)
stack: |-
Error: is betewen 0 and 1
at Test.assert [as _assert] (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:225:54)
at Test.bound [as _assert] (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:77:32)
at Test.assert (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:343:10)
at Test.bound [as ok] (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:77:32)
at Object.metrics.system.process.cpu.total.norm.pct (C:\projects\apm-agent-nodejs\test\metrics\index.js:109:13)
at Object.mockAgent [as sendMetricSet] (C:\projects\apm-agent-nodejs\test\metrics\index.js:132:20)
at afterAll (C:\projects\apm-agent-nodejs\lib\metrics\reporter.js:32:24)
at C:\projects\apm-agent-nodejs\node_modules\after-all-results\index.js:20:25
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)
...
# system.process.cpu.system.norm.pct
ok 43 is present
ok 44 is a number
ok 45 is finite (was: 0)
ok 46 is betewen 0 and 1
# system.process.cpu.user.norm.pct
ok 47 is present
ok 48 is a number
ok 49 is finite (was: 1.4355878313710884)
not ok 50 is betewen 0 and 1
---
operator: ok
expected: true
actual: false
at: Object.metrics.system.process.cpu.user.norm.pct (C:\projects\apm-agent-nodejs\test\metrics\index.js:119:13)
stack: |-
Error: is betewen 0 and 1
at Test.assert [as _assert] (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:225:54)
at Test.bound [as _assert] (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:77:32)
at Test.assert (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:343:10)
at Test.bound [as ok] (C:\projects\apm-agent-nodejs\node_modules\tape\lib\test.js:77:32)
at Object.metrics.system.process.cpu.user.norm.pct (C:\projects\apm-agent-nodejs\test\metrics\index.js:119:13)
at Object.mockAgent [as sendMetricSet] (C:\projects\apm-agent-nodejs\test\metrics\index.js:132:20)
at afterAll (C:\projects\apm-agent-nodejs\lib\metrics\reporter.js:32:24)
at C:\projects\apm-agent-nodejs\node_modules\after-all-results\index.js:20:25
at _combinedTickCallback (internal/process/next_tick.js:132:7)
at process._tickCallback (internal/process/next_tick.js:181:9)
...
```
Contributor guide
Assessment
This issue has not been assessed yet.