纱线api通过elapsedTime获取应用程序 [英] Yarn api get applications by elapsedTime
问题描述
是否有一种简单的方法来查询yarn应用程序api,以获取运行时间超过x倍的应用程序?
Is there an easy way to query the yarn applications api to get applications which have run for more than x amount of time?
以下网址提供了应用列表,但看起来并没有遵循elapsedTime参数
Following url gives a list of apps, but doesn't look like it respects the elapsedTime parameter
http://<RM_DOMAIN>:<RM_PORT>/ws/v1/cluster/apps?states=RUNNING&elapsedTime=200000
推荐答案
elapsedTime
不是受支持的查询参数.
您可以使用jq
过滤符合条件的应用.
elapsedTime
is not a supported Query Parameter.
You can use jq
to filter the apps that match the criteria.
curl http://<RM_DOMAIN>:<RM_PORT>/ws/v1/cluster/apps?states=RUNNING | jq '.apps.app[]| select(.elapsedTime > 200000)'
或者您可以使用startedTimeBegin
参数,以开始时间从该时间开始的所有应用程序获取(从纪元开始的毫秒数).例如,
Or you can use startedTimeBegin
parameter, to get all the apps with start time beginning with this time (ms since epoch). For example,
curl http://<RM_DOMAIN>:<RM_PORT>/ws/v1/cluster/apps?states=RUNNING&startedTimeBegin=1492968581437
这篇关于纱线api通过elapsedTime获取应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!