在 flink 中测量作业执行时间 [英] Measure job execution time in flink

查看:50
本文介绍了在 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?

附注.我希望 flink API 给我时间,而不是通过记录开始和结束时间在 bash 中自己测量时间

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屋!

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