title: How to find the CPU time taken by a Map/Reduce task in Hadoop
body: <p>I am writing a Hadoop scheduler. My scheduling requires finding the CPU time taken by each Map/Reduce task. </p>
  
  <p>I know that:</p>
  
  <ul>
  <li><p>The TaskInProgress class maintains the execStartTime and execFinishTime values which are wall-clock times when the process started and finished, but they do not accurately indicate the CPU time consumed by the task.</p></li>
  <li><p>Each task is executed in a new JVM, and I could use the OperatingSystemMXBean.<a href="http://docs.oracle.com/javase/1.5.0/docs/guide/management/extension/com/sun/management/OperatingSystemMXBean.html#getProcessCpuTime%28%29" rel="nofollow">getProcessCpuTime</a> () method, but again the description of the method tells me: "Returns the CPU time used by the process on which the Java virtual machine is running in nanoseconds". I am not entirely clear if this is what I want. </p></li>
  </ul>