Get the Node Usage Related Metrics
/console/admin/api/v1.1/dashboard/statistics/nodeRes
Request
- application/json
-
endTime(optional): string
The end time of a time range in the format 'yyyyMMddhhmmss'
-
nodeID(optional): string
Node ID of a specific peer, orderer, proxy, or the console itself
-
startTime(optional): string
The start time of a time range in the format 'yyyyMMddhhmmss'
Response
- application/json
200 Response
400 Response
Default Response
Examples
This endpoint is used to get the node usage related metrics such as CPU, memory, and disk usage percentages, reflecting the health metrics you can see on the console. The result is a JSON body which contains a series of usage records for the specified nodes in the specified time range. If nodeID
is not specified, it returns this information for all nodes in the instance. If the time range is specified, the returned usage information is the average value of all the usage over the specified time range. If time range is not specified, the latest usage information is returned, plus a one minute time range.
The following example shows how to generate the node metrics by submitting a GET request on the REST resource using cURL.
curl -X GET -u username:password -k "http://<rest_server_url>:port/console/admin/api/v1.1/dashboard/statistics/nodeRes?nodeID=<nodeID>&startTime=<yyyymmddhhmmss>&endTime=yyyymmddhhmmss"
For example,
curl -X GET -u myname@oracle.com:mypswd -k "http://server.oracle.com:10000/console/admin/api/v1.1/dashboard/statistics/nodeRes?nodeID=peer0-1&startTime=20190224000000&endTime=20190224050000"
Example of the Response Body
The following example shows the contents of the response body in JSON format:
{ "data": [ { "nodeId": "peer0-1", "nodeType": "peer", "resUsage": { "startTime": "Sun, 24 Feb 2019 00:00:00 GMT", "endTime": "Sun, 24 Feb 2019 05:00:00 GMT", "cpu": 2.8215833333333333, "memory": 0.34320972222222224, "disk": 0.065 } } ] }