Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"xpumcli stats" JSON format is awkward #51

Open
eero-t opened this issue Jun 2, 2023 · 0 comments
Open

"xpumcli stats" JSON format is awkward #51

eero-t opened this issue Jun 2, 2023 · 0 comments

Comments

@eero-t
Copy link

eero-t commented Jun 2, 2023

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.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant