Hello
I'm pulling stats for all VMs to understand CPU usage. We're a bit behind the curve in terms of XO versions, but these questions hopefully are still relevant.
If using a granularity of days, the interval is set to 86400 (understandably) but the endTimestamp varies. Running this on June 9th @ ~1740 we get timestamps for both Mon Jun 8 01:00:00 AM BST 2026 and Tues Jun 9 01:00:00 AM BST 2026.
- Does this average across the day? Why is the timestamp 0100?
- Why would there be different timestamps between VMs (all are running) and does that mean that the figures are misaligned in the results?
These are retrieved via curl and a bash script, a bit hacky, but for clarity the request is:
++ curl -X GET -s -H accept:application/json -b authenticationToken=[[REDACTED]] -o [[REDACTED]] 'https://[[REDACTED]]/rest/v0/vms/[[REDACTED]]/stats?granularity=days'
-
Really keen to know if we can control the start and endtime, as well as provide a manual interval, as well as the aggregation strategy (min, max, average). Are any of these possible?
-
Lastly, is cpuUsage the percentage as per the dashboard, but averaged over all CPUs?
Thanks so much in advance. 
James