Support Questions

Find answers, ask questions, and share your expertise

REST API path to get cluster memory used for a particular queue for a time period

avatar
Expert Contributor

Hi, i am trying to get the ambari metrics rest api path to get the memory usage for a particular queue Q1 for the last 1 week. how can i get that?

1 ACCEPTED SOLUTION

avatar
Master Mentor

@PJ

Last 7 Days of Memory For Yarn Queues :

1. Allocated Memory of "default" queue:

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....


2. Reserved Memory of "default" queue:

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....


3. Pending Memory of "default" queue:

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....


4. Available Memory of "default" queue

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....



Please replace the following in the above queries:

1. "AMS_COLLECTOR_HOSTNAME:6188" with your Ambari Metrics Collector Hostname and port (default port is 6188)

2. Name of the queue "default" with the name of your own queue which you want to monitor.

3. Change the StartTime and endTime in the query to cover last 7 days.
You can use some online tool to generate the EPOC time like https://www.epochconverter.com/

Make sure that the generated epooc time is in milliseconds like 10 digits.

.

View solution in original post

3 REPLIES 3

avatar
Master Mentor

@PJ

Last 7 Days of Memory For Yarn Queues :

1. Allocated Memory of "default" queue:

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....


2. Reserved Memory of "default" queue:

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....


3. Pending Memory of "default" queue:

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....


4. Available Memory of "default" queue

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....



Please replace the following in the above queries:

1. "AMS_COLLECTOR_HOSTNAME:6188" with your Ambari Metrics Collector Hostname and port (default port is 6188)

2. Name of the queue "default" with the name of your own queue which you want to monitor.

3. Change the StartTime and endTime in the query to cover last 7 days.
You can use some online tool to generate the EPOC time like https://www.epochconverter.com/

Make sure that the generated epooc time is in milliseconds like 10 digits.

.

avatar
Expert Contributor

@Jay Kumar SenSharma

It works, Great!! There was a typo in your command.

This works for me:

  1. http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....

Thanks again.

avatar
Expert Contributor

@Jay Kumar SenSharma

Thank you so much for the explanation and commands, but i am getting 404 not found error when i try to run this command using curl. I see there are some special characters and was wondering if it has to do anything with it?

For eg below path has a ☆ before tTime and after max there is a = curly sign.

http://$AMS_COLLECTOR_HOSTNAME:6188/ws/v1/timeline/metrics?metricNames=yarn.QueueMetrics.Queue=root....pId=resourcemanagertTime=1545613074&endTime=1546217874