问题
Is there any way to measure job execution time in Apache Flink when submitting the job to flink using command line?
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
回答1:
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");
来源:https://stackoverflow.com/questions/34243365/measure-job-execution-time-in-flink