Hi I am trying to run the WordCount program with Hadoop in local/standalone mode and I want to see the time needed for the task. I'm using the code from the Hadoop website. I tried adding this at the end of the code but it prints out 0.
job.waitForCompletion(true);
long time = job.getFinishTime() - job.getStartTime();
System.out.println("Time taken = " + time);
I also tried this method but it prints out nothing instead.
job.waitForCompletion();
TaskReport[] reports = job.getTaskReports(TaskType.MAP);
for(TaskReport report : reports) {
long time = report.getFinishTime() - report.getStartTime();
System.out.println(report.getTaskId() + " took " + time + " millis!");
}
Is there another way to see the elapsed time in milliseconds in Hadoop standalone mode? Many thanks!