在Flink中测量作业执行时间 [英] Measure job execution time in flink
本文介绍了在Flink中测量作业执行时间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用命令行将作业提交给flink时,是否有任何方法可以测量Apache Flink中的作业执行时间?
Is there any way to measure job execution time in Apache Flink when submitting the job to flink using command line?
PS.我希望flink API给我时间,而不是通过记录开始时间和结束时间
PS. I want the flink API to give me the time rather than measuring it myself in bash by noting the start and end times
推荐答案
ExecutionEnvironment.execute()
方法返回包含作业运行时的JobExecutionResult
对象.
The ExecutionEnvironment.execute()
method returns a JobExecutionResult
object containing the job runtime.
例如,您可以执行以下操作:
You could for example do something like this:
// execute program
JobExecutionResult result = env.execute("My Flink Job");
System.out.println("The job took " + result.getNetRuntime(TimeUnit.SECONDS) + " to execute");
这篇关于在Flink中测量作业执行时间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文