orak
orak

Reputation: 2419

Measure job execution time in flink

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

Upvotes: 8

Views: 1766

Answers (1)

Robert Metzger
Robert Metzger

Reputation: 4542

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");

Upvotes: 13

Related Questions