XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    vm.stats questions on response and parameters

    Scheduled Pinned Locked Moved REST API
    1 Posts 1 Posters 11 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Online
      jcirc
      last edited by jcirc

      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.

      1. Does this average across the day? Why is the timestamp 0100?
      2. 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'

      1. 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?

      2. Lastly, is cpuUsage the percentage as per the dashboard, but averaged over all CPUs?

      Thanks so much in advance. 😃

      James

      1 Reply Last reply Reply Quote 0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      • First post
        Last post