intel / intel/xpumanager

"xpumcli stats" JSON format is awkward

Open
#51 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
194
Forks
34
PR merge metrics
No merged PRs in 30d

Description

`xpumcli stats` JSON output puts _all_ metric types to a _same_ array. That makes it hard to retrieve specific metric in automated way, as one can gets basically a random metric type (here it happens to be power):
```
$ xpumcli stats --json --device 0 | jq .device_level[0]
{
"avg": 40.12,
"max": 41.15,
"metrics_type": "XPUM_STATS_POWER",
"min": 40.11,
"value": 40.63
}
```
If each metric type would be under its own key, it would be trivial to get specific metric values:
```
$ xpumcli stats --json --device 0 | jq .device_level.XPUM_STATS_POWER[].avg
40.12
```

(If there were multiple power values, above `jq` clause would list them all.)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.