github.com/ncodes/nomad@v0.5.7-0.20170403112158-97adf4a74fb3/website/source/docs/http/client-allocation-stats.html.md (about)

     1  ---
     2  layout: "http"
     3  page_title: "HTTP API: /v1/client/allocation/stats"
     4  sidebar_current: "docs-http-client-allocation-stats"
     5  description: |-
     6    The '/v1/client/allocation/` endpoint is used to query the actual resources
     7    consumed by an allocation.
     8  ---
     9  
    10  # /v1/client/allocation
    11  
    12  The client `allocation` endpoint is used to query the actual resources consumed
    13  by an allocation.  The API endpoint is hosted by the Nomad client and requests
    14  have to be made to the nomad client whose resource usage metrics are of
    15  interest.
    16  
    17  ## GET
    18  
    19  <dl>
    20    <dt>Description</dt>
    21    <dd>
    22       Query resource usage of an allocation running on a client.
    23    </dd>
    24  
    25    <dt>Method</dt>
    26    <dd>GET</dd>
    27  
    28    <dt>URL</dt>
    29    <dd>`/v1/client/allocation/<ID>/stats`</dd>
    30  
    31    <dt>Returns</dt>
    32    <dd>
    33  
    34    ```javascript
    35      {
    36        "ResourceUsage": {
    37          "CpuStats": {
    38            "Measured": [
    39              "System Mode",
    40              "User Mode",
    41              "Percent"
    42            ],
    43            "Percent": 105.77854560628487,
    44            "SystemMode": 6.860067935411291,
    45            "ThrottledPeriods": 0,
    46            "ThrottledTime": 0,
    47            "TotalTicks": 714.0051828424228,
    48            "UserMode": 98.9184820888787
    49          },
    50          "MemoryStats": {
    51            "Cache": 0,
    52            "KernelMaxUsage": 0,
    53            "KernelUsage": 0,
    54            "MaxUsage": 0,
    55            "Measured": [
    56              "RSS",
    57              "Swap"
    58            ],
    59            "RSS": 14098432,
    60            "Swap": 0
    61          }
    62        },
    63        "Tasks": {
    64          "redis": {
    65            "Pids": {
    66              "27072": {
    67                "CpuStats": {
    68                  "Measured": [
    69                    "System Mode",
    70                    "User Mode",
    71                    "Percent"
    72                  ],
    73                  "Percent": 6.8607999603563385,
    74                  "SystemMode": 5.880684245133524,
    75                  "ThrottledPeriods": 0,
    76                  "ThrottledTime": 0,
    77                  "TotalTicks": 0,
    78                  "UserMode": 0.9801144039714172
    79                },
    80                "MemoryStats": {
    81                  "Cache": 0,
    82                  "KernelMaxUsage": 0,
    83                  "KernelUsage": 0,
    84                  "MaxUsage": 0,
    85                  "Measured": [
    86                    "RSS",
    87                    "Swap"
    88                  ],
    89                  "RSS": 13418496,
    90                  "Swap": 0
    91                }
    92              },
    93              "27073": {
    94                "CpuStats": {
    95                  "Measured": [
    96                    "System Mode",
    97                    "User Mode",
    98                    "Percent"
    99                  ],
   100                  "Percent": 98.91774564592852,
   101                  "SystemMode": 0.9793836902777665,
   102                  "ThrottledPeriods": 0,
   103                  "ThrottledTime": 0,
   104                  "TotalTicks": 0,
   105                  "UserMode": 97.93836768490729
   106                },
   107                "MemoryStats": {
   108                  "Cache": 0,
   109                  "KernelMaxUsage": 0,
   110                  "KernelUsage": 0,
   111                  "MaxUsage": 0,
   112                  "Measured": [
   113                    "RSS",
   114                    "Swap"
   115                  ],
   116                  "RSS": 679936,
   117                  "Swap": 0
   118                }
   119              }
   120            },
   121            "ResourceUsage": {
   122              "CpuStats": {
   123                "Measured": [
   124                  "System Mode",
   125                  "User Mode",
   126                  "Percent"
   127                ],
   128                "Percent": 105.77854560628487,
   129                "SystemMode": 6.860067935411291,
   130                "ThrottledPeriods": 0,
   131                "ThrottledTime": 0,
   132                "TotalTicks": 714.0051828424228,
   133                "UserMode": 98.9184820888787
   134              },
   135              "MemoryStats": {
   136                "Cache": 0,
   137                "KernelMaxUsage": 0,
   138                "KernelUsage": 0,
   139                "MaxUsage": 0,
   140                "Measured": [
   141                  "RSS",
   142                  "Swap"
   143                ],
   144                "RSS": 14098432,
   145                "Swap": 0
   146              }
   147            },
   148            "Timestamp": 1465865820750959600
   149          }
   150        },
   151        "Timestamp": 1465865820750959600
   152      }
   153    ```
   154    </dd>
   155  </dl>