<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: YARN - Is there a metric in RM for Number of Containers got preempted over time in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/YARN-Is-there-a-metric-in-RM-for-Number-of-Containers-got/m-p/217415#M69383</link>
    <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/3369/gnovak.html" nodeid="3369"&gt;@gnovak&lt;/A&gt; currently I am getting app level details similarly as mentioned above using REST API. I am interested to see if there is anything at queue level. &lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2017 00:18:23 GMT</pubDate>
    <dc:creator>sparepally</dc:creator>
    <dc:date>2017-10-12T00:18:23Z</dc:date>
    <item>
      <title>YARN - Is there a metric in RM for Number of Containers got preempted over time</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/YARN-Is-there-a-metric-in-RM-for-Number-of-Containers-got/m-p/217413#M69381</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I am looking for a Resource Manager metric where it emits metrics related to number of containers preempted, amount of preempted MB and Vcores. &lt;/P&gt;&lt;P&gt;I am able to get this metric from each application, but looking if resource manager can emit these metrics for each queue. I have searched through all the different metrics in AMS but it doesn't have it. &lt;/P&gt;&lt;P&gt;HDPv2.5.0 or Hadoopv2.7.3&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 07:46:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/YARN-Is-there-a-metric-in-RM-for-Number-of-Containers-got/m-p/217413#M69381</guid>
      <dc:creator>sparepally</dc:creator>
      <dc:date>2017-10-11T07:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: YARN - Is there a metric in RM for Number of Containers got preempted over time</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/YARN-Is-there-a-metric-in-RM-for-Number-of-Containers-got/m-p/217414#M69382</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/14265/parepallykiran.html" nodeid="14265"&gt;@Saikiran Parepally&lt;/A&gt; &lt;/P&gt;&lt;P&gt;I don't think queue level preemption metrics exists. However, they are fairly easy to calculate from the app level metrics. &lt;/P&gt;&lt;PRE&gt;curl &lt;A href="http://YOUR_RM_ADDRESS.com:8088/ws/v1/cluster/apps" target="_blank"&gt;http://YOUR_RM_ADDRESS.com:8088/ws/v1/cluster/apps&lt;/A&gt; &amp;gt; /tmp/apps
queues=$(cat /tmp/apps | jq '.apps.app[].queue' | sort -u)
for queue in $queues; do
    echo $queue
    metrics="preemptedResourceMB preemptedResourceVCores numNonAMContainerPreempted numAMContainerPreempted"
    for metric in $metrics; do
        printf "%30s: " $metric 
        cat /tmp/apps | jq -r ".apps.app[] | select(.queue == $queue) .$metric" | paste -s -d+ - | bc
    done    
done
&lt;/PRE&gt;&lt;P&gt;Most likely there are more efficient ways to to do this calculation in higher level programming languages, or if you are a jq expert.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Oct 2017 16:44:53 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/YARN-Is-there-a-metric-in-RM-for-Number-of-Containers-got/m-p/217414#M69382</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2017-10-11T16:44:53Z</dc:date>
    </item>
    <item>
      <title>Re: YARN - Is there a metric in RM for Number of Containers got preempted over time</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/YARN-Is-there-a-metric-in-RM-for-Number-of-Containers-got/m-p/217415#M69383</link>
      <description>&lt;P&gt;Thanks &lt;A rel="user" href="https://community.cloudera.com/users/3369/gnovak.html" nodeid="3369"&gt;@gnovak&lt;/A&gt; currently I am getting app level details similarly as mentioned above using REST API. I am interested to see if there is anything at queue level. &lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2017 00:18:23 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/YARN-Is-there-a-metric-in-RM-for-Number-of-Containers-got/m-p/217415#M69383</guid>
      <dc:creator>sparepally</dc:creator>
      <dc:date>2017-10-12T00:18:23Z</dc:date>
    </item>
  </channel>
</rss>

