Sign up

Get metrics

GET/api/v1/vps/{vps_uuid}/metrics

CPU, memory, network, disk and pressure from the host side, averaged over each point, for the last hour, day or week. A new server has no history before it was created.

Parameters

NameInDescription
vps_uuidpath, stringrequiredVPS id, from Create a VPS or List VPS
timeframequery, string

Example request

curl -X GET "https://platform.serverscamp.com/api/v1/vps/$VPS_UUID/metrics?timeframe=hour" \
  -H "Authorization: Bearer $API_TOKEN"

Answer

Status 200 with this body.

FieldTypeDescription
timeframeone of hour, day, weekrequired
pointslist of VpsMetricsPointrequiredFrom the host side; null where the server was off
points[].tintegerrequiredUnix time of the point
points[].cpunumber, optionalShare of all the server's vCPUs in use, 0 to 1
points[].memnumber, optionalMemory the server takes, bytes
points[].maxmemnumber, optionalMemory of the plan, bytes
points[].netinnumber, optionalTraffic into the server, bytes a second
points[].netoutnumber, optionalTraffic out of the server, bytes a second
points[].diskreadnumber, optionalDisk reads, bytes a second
points[].diskwritenumber, optionalDisk writes, bytes a second
points[].pressurecpusomenumber, optionalShare of time some programs waited for CPU, percent
points[].pressurecpufullnumber, optionalShare of time all programs waited for CPU, percent
points[].pressurememorysomenumber, optionalThe same for memory, some programs
points[].pressurememoryfullnumber, optionalThe same for memory, all programs
points[].pressureiosomenumber, optionalThe same for disk, some programs
points[].pressureiofullnumber, optionalThe same for disk, all programs
{
  "timeframe": "hour",
  "points": [
    {
      "t": 1792656000,
      "cpu": 0.0312,
      "mem": 412311552,
      "maxmem": 805306368,
      "netin": 1843.2,
      "netout": 9216.5,
      "diskread": 0,
      "diskwrite": 40960,
      "pressurecpusome": 0.41,
      "pressurecpufull": 0,
      "pressurememorysome": 0,
      "pressurememoryfull": 0,
      "pressureiosome": 0.12,
      "pressureiofull": 0.05
    }
  ]
}

Errors

StatusWhen
400timeframe is not hour, day or week
401No token, or a token that is not valid
422The body or a parameter is not what the operation takes

Every operation can also answer 401 without a valid token. All errors