2016-06-14 00:58:33 +00:00
|
|
|
---
|
|
|
|
layout: "http"
|
2016-06-15 13:46:17 +00:00
|
|
|
page_title: "HTTP API: /v1/client/allocation/stats"
|
2016-06-14 00:58:33 +00:00
|
|
|
sidebar_current: "docs-http-client-allocation-stats"
|
|
|
|
description: |-
|
2016-06-25 01:00:29 +00:00
|
|
|
The '/v1/client/allocation/` endpoint is used to query the actual resources
|
|
|
|
consumed by an allocation.
|
2016-06-14 00:58:33 +00:00
|
|
|
---
|
|
|
|
|
2016-06-25 01:00:29 +00:00
|
|
|
# /v1/client/allocation
|
2016-06-14 00:58:33 +00:00
|
|
|
|
2016-06-25 01:00:29 +00:00
|
|
|
The client `allocation` endpoint is used to query the actual resources consumed
|
|
|
|
by an allocation. The API endpoint is hosted by the Nomad client and requests
|
|
|
|
have to be made to the nomad client whose resource usage metrics are of
|
|
|
|
interest.
|
2016-06-14 00:58:33 +00:00
|
|
|
|
|
|
|
## GET
|
|
|
|
|
|
|
|
<dl>
|
|
|
|
<dt>Description</dt>
|
|
|
|
<dd>
|
|
|
|
Query resource usage of an allocation running on a client.
|
|
|
|
</dd>
|
|
|
|
|
|
|
|
<dt>Method</dt>
|
|
|
|
<dd>GET</dd>
|
|
|
|
|
|
|
|
<dt>URL</dt>
|
2016-06-23 18:48:31 +00:00
|
|
|
<dd>`/v1/client/allocation/<ID>/stats`</dd>
|
2016-06-14 00:58:33 +00:00
|
|
|
|
|
|
|
<dt>Returns</dt>
|
|
|
|
<dd>
|
2016-06-15 13:46:17 +00:00
|
|
|
|
|
|
|
```javascript
|
|
|
|
{
|
|
|
|
"ResourceUsage": {
|
|
|
|
"CpuStats": {
|
|
|
|
"Measured": [
|
|
|
|
"System Mode",
|
|
|
|
"User Mode",
|
|
|
|
"Percent"
|
|
|
|
],
|
|
|
|
"Percent": 105.77854560628487,
|
|
|
|
"SystemMode": 6.860067935411291,
|
|
|
|
"ThrottledPeriods": 0,
|
|
|
|
"ThrottledTime": 0,
|
|
|
|
"TotalTicks": 714.0051828424228,
|
|
|
|
"UserMode": 98.9184820888787
|
|
|
|
},
|
|
|
|
"MemoryStats": {
|
|
|
|
"Cache": 0,
|
|
|
|
"KernelMaxUsage": 0,
|
|
|
|
"KernelUsage": 0,
|
|
|
|
"MaxUsage": 0,
|
|
|
|
"Measured": [
|
|
|
|
"RSS",
|
|
|
|
"Swap"
|
|
|
|
],
|
|
|
|
"RSS": 14098432,
|
|
|
|
"Swap": 0
|
|
|
|
}
|
2016-06-14 00:58:33 +00:00
|
|
|
},
|
2016-06-15 13:46:17 +00:00
|
|
|
"Tasks": {
|
|
|
|
"redis": {
|
|
|
|
"Pids": {
|
|
|
|
"27072": {
|
|
|
|
"CpuStats": {
|
|
|
|
"Measured": [
|
|
|
|
"System Mode",
|
|
|
|
"User Mode",
|
|
|
|
"Percent"
|
|
|
|
],
|
|
|
|
"Percent": 6.8607999603563385,
|
|
|
|
"SystemMode": 5.880684245133524,
|
|
|
|
"ThrottledPeriods": 0,
|
|
|
|
"ThrottledTime": 0,
|
|
|
|
"TotalTicks": 0,
|
|
|
|
"UserMode": 0.9801144039714172
|
|
|
|
},
|
|
|
|
"MemoryStats": {
|
|
|
|
"Cache": 0,
|
|
|
|
"KernelMaxUsage": 0,
|
|
|
|
"KernelUsage": 0,
|
|
|
|
"MaxUsage": 0,
|
|
|
|
"Measured": [
|
|
|
|
"RSS",
|
|
|
|
"Swap"
|
|
|
|
],
|
|
|
|
"RSS": 13418496,
|
|
|
|
"Swap": 0
|
|
|
|
}
|
2016-06-14 00:58:33 +00:00
|
|
|
},
|
2016-06-15 13:46:17 +00:00
|
|
|
"27073": {
|
|
|
|
"CpuStats": {
|
|
|
|
"Measured": [
|
|
|
|
"System Mode",
|
|
|
|
"User Mode",
|
|
|
|
"Percent"
|
|
|
|
],
|
|
|
|
"Percent": 98.91774564592852,
|
|
|
|
"SystemMode": 0.9793836902777665,
|
|
|
|
"ThrottledPeriods": 0,
|
|
|
|
"ThrottledTime": 0,
|
|
|
|
"TotalTicks": 0,
|
|
|
|
"UserMode": 97.93836768490729
|
|
|
|
},
|
|
|
|
"MemoryStats": {
|
|
|
|
"Cache": 0,
|
|
|
|
"KernelMaxUsage": 0,
|
|
|
|
"KernelUsage": 0,
|
|
|
|
"MaxUsage": 0,
|
|
|
|
"Measured": [
|
|
|
|
"RSS",
|
|
|
|
"Swap"
|
|
|
|
],
|
|
|
|
"RSS": 679936,
|
|
|
|
"Swap": 0
|
|
|
|
}
|
2016-06-14 00:58:33 +00:00
|
|
|
}
|
|
|
|
},
|
2016-06-15 13:46:17 +00:00
|
|
|
"ResourceUsage": {
|
2016-06-14 00:58:33 +00:00
|
|
|
"CpuStats": {
|
|
|
|
"Measured": [
|
|
|
|
"System Mode",
|
|
|
|
"User Mode",
|
|
|
|
"Percent"
|
|
|
|
],
|
2016-06-15 13:46:17 +00:00
|
|
|
"Percent": 105.77854560628487,
|
|
|
|
"SystemMode": 6.860067935411291,
|
2016-06-14 00:58:33 +00:00
|
|
|
"ThrottledPeriods": 0,
|
|
|
|
"ThrottledTime": 0,
|
2016-06-15 13:46:17 +00:00
|
|
|
"TotalTicks": 714.0051828424228,
|
|
|
|
"UserMode": 98.9184820888787
|
2016-06-14 00:58:33 +00:00
|
|
|
},
|
|
|
|
"MemoryStats": {
|
|
|
|
"Cache": 0,
|
|
|
|
"KernelMaxUsage": 0,
|
|
|
|
"KernelUsage": 0,
|
|
|
|
"MaxUsage": 0,
|
|
|
|
"Measured": [
|
|
|
|
"RSS",
|
|
|
|
"Swap"
|
|
|
|
],
|
2016-06-15 13:46:17 +00:00
|
|
|
"RSS": 14098432,
|
2016-06-14 00:58:33 +00:00
|
|
|
"Swap": 0
|
|
|
|
}
|
|
|
|
},
|
2016-06-15 13:46:17 +00:00
|
|
|
"Timestamp": 1465865820750959600
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"Timestamp": 1465865820750959600
|
|
|
|
}
|
2016-06-14 00:58:33 +00:00
|
|
|
```
|
|
|
|
</dd>
|
|
|
|
</dl>
|