Pig Performance Measurement

感情迁移 提交于 2019-12-13 04:46:43

问题


I wrote a Pig script and want to execute it on Hadoop cluster. How could I measure the total processing time? Is there any command that I could get the processing time from start to end?


回答1:


EDIT: Added the time alternative.

To know how long it takes (in seconds):

time pig <options>

Another way to do it:

d1=$(date +%s)
pig <options>
d2=$(date +%s)
echo "$d2 - $d1" | bc

Or, in a single line:

d1=$(date +%s) ; pig <options> ; d2=$(date +%s) ; echo "$d2 - $d1" | bc

You can also just take a look at the output of pig. When you run a pig script in the command line, towards the end of the output you'll see:

HadoopVersion   PigVersion  UserId  StartedAt   FinishedAt  Features
...

You can then subtract FinishedAt - StartedAt.



来源:https://stackoverflow.com/questions/19434894/pig-performance-measurement

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