How to get statistics for Nodes and ADCs through the API.

## Node Statistics

Node Statistics are the physical machine, virtual machine or containers performance related statistics. Actual ADC statistics are separated from individual Nodes.

```
{
"id": x,
[..]
"status": "online",
"cpu": 24,
"memory": 27.715171564977,
"connections": 225
}
```

As you can see above, the Get a Node endpoint provides CPU, Memory and active Connections.

## ADC Statistics

ADC's always run on at least one Node (if deployed), and possible many Nodes. To get statistics for an ADC you need to query the ADC Attachments API, which will return the Nodes attached to an ADC and the statistics for it. A shortened example is below:

```
{
"items": [
{
"attachMethod": "id",
"node": {
"id": 20892,
[..]
"name": "example",
"status": "online"
},
"stats": {
"cachedObjects": 63,
[..]
}
}
],
[..]
}
```

The "stats" key provides detailed statistics. They are either in absolute format (e.g. bytesOutRate) or a counter which is reset on deploy. To get historical statistics for an ADC you must use the ADC statistics API which handles the conversion of counters into rates.

```
"stats": {
"cachedObjects": 63,
"cachedRequests": 149708,
"cachedSize": 1743959,
"backendsUp": 2,
"backendsDown": 0,
"backendsCount": 2,
"backendsRequestsLast1024QueueTimeAverage": 0,
"backendsRequestsLast1024ConnectTimeAverage": 1,
"backendsRequestsLast1024ResponseTimeAverage": 883,
"backendsRequestsLast1024SessionTimeAverage": 1142,
"bytesIn": 0,
"bytesInRate": 0,
"bytesInTotal": 179532320,
"bytesOut": 20255,
"bytesOutRate": 2025,
"bytesOutTotal": 10736699528,
"compressorBytesIn": 0,
"compressorBytesOut": 0,
"compressorBytesBypassed": 0,
"connections": 10,
"connectionsRate": 2,
"connectionsTotal": 435249,
"connectionsDenied": 0,
"connectionsDeniedTotal": 0,
"connectionsErrors": 0,
"connectionsErrorsTotal": 0,
"denied": 0,
"httpRequests": 5,
"httpRequestsRate": 1,
"httpRequestsRateMax": 215,
"httpRequestsTotal": 410678,
"httpResponses": 5
}
```