Say, for last 5 minutes what is the cpu usage for 5 minutes averaged across all nodes in the cluster?
I can see that in Ambari, but I want information in the given time range and I should be able to get that information with an API call.
Hi @naveen r
If you have ambari metrics installed you can do this with REST API. For example;
curl -u admin:admin -H 'X-Requested-By:ambari' -X GET "https//localhost:8080/api/v1/clusters/<your cluster name>/?fields=metrics/load/CPUs._avg[1534230000,1534231500,15]"
Note that ;
X = start time, Y = end time, 15 = step value used for zero padding or null padding
More examples and official documentation on:
View solution in original post
How do I get the memory usage avg.?
There are a variety of options for memory. I just tried the same for my cluster and using for example fields=metrics/memory/Use._avg[1534235091,1534235391,15] worked well.
Further options quoted from the source code;