(mt):Get current stats
- This page was last modified on February 18, 2011, at 10:05.
From (mt) Community Wiki
This method provides a way to retrieve the current resource usage levels for a specific (mt) Media Temple server.
Contents |
Request info
The following URL and HTTP method should be used:
| HTTP Method | URL |
|---|---|
| GET | https://api.mediatemple.net/api/v1/stats/{serviceId} |
The following parameters must be provided in the URL:
| Parameter | Type | Description |
|---|---|---|
| serviceId | int | The service id. |
Response info
The response will return an HTTP status code to indicate the general category of success or failure to the client. More specific error codes and messages will be contained in the response data itself, if provided. For more information on response codes and parsing response data, see Parsing API responses.
Sample request
To get the stats for service 1000 in JSON format, do the following:
curl -D log.txt -s -X "GET" "https://api.mediatemple.net/api/v1/stats/1000.json?apikey=a5h34sf62..."
Sample response
Here is an example of the returned result:
{
"stats" : {
"timeStamp" : 1284170031,
"cpu" : 69.76,
"memory" : 59.8,
"load1Min" : 19.93,
"load5Min" : 29.9,
"load15Min" : 39.86,
"processes" : 50,
"diskSpace" : 49.83,
"kbytesIn" : 79.73,
"kbytesOut" : 89.69,
"packetsIn" : 99.66,
"packetsOut" : 109.62,
"state" : 1
}
}
Response fields
The fields in the result represent the following:
| Field | Description |
|---|---|
| timeStamp | The time these stats were recorded |
| cpu | The percentage of CPU being consumed |
| memory | The percentage of memory currently allocated |
| load1Min | The system load average for the past minute |
| load5Min | The system load average for the past 5 minutes |
| load15Min | The system load average for the past 15 minutes |
| processes | The number of processes currently running |
| diskSpace | The percentage of disk space currently used |
| kbytesIn | The kilobytes in per second |
| kbytesOut | The kilobytes out per second |
| packetsIn | The packets in per second |
| packetsOut | The packets out per second |
| state | The server state (0=off, 1=running) |