猪性能测量 [英] Pig Performance Measurement

查看:26
本文介绍了猪性能测量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我写了一个 Pig 脚本,想在 Hadoop 集群上执行它.我如何衡量总处理时间?有什么命令可以让我得到从开始到结束的处理时间吗?

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?

推荐答案

添加了 time 替代方案.

Added the time alternative.

要知道需要多长时间(以秒为单位):

To know how long it takes (in seconds):

time pig <options>

另一种方法:

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

或者,在一行中:

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

你也可以看看pig的输出.当您在命令行中运行 Pig 脚本时,您会在输出的末尾看到:

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
...

然后您可以减去FinishedAt - StartedAt.

这篇关于猪性能测量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆