Yarn api get applications by elapsedTime

牧云@^-^@ 提交于 2019-12-11 05:54:38

问题


Is there an easy way to query the yarn applications api to get applications which have run for more than x amount of time?

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


回答1:


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)'

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


来源:https://stackoverflow.com/questions/43552215/yarn-api-get-applications-by-elapsedtime

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!