[ 
https://issues.apache.org/jira/browse/MAPREDUCE-1201?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Scott Chen updated MAPREDUCE-1201:
----------------------------------

    Attachment: MAPREDUCE-1201-v2.patch

Thanks for marking the issue to blocked, Vinod

I am submitting this again with the update in MAPREDUCE-1167

This patch does the following things:
1. Parse utime and stime in /proc/<pid>/stat for all the subprocesses under the 
assigned PID (see "man proc" for the definition of utime and stime)
2. Compute the CPU time gained for each subprocess (utime + stime) - 
(last_utime + last_stime). If this is the first time the subprocess is seen, 
last_utime = 0 and last_stime = 0.
3. Sum the CPU time gained and update the cumulative CPU time of the process 
tree

This may seem confusing. Note that we cannot simply sum up (utime + stime) for 
all the subprocesses. This is because some of the subprocesses may finish 
before the process tree finishes. So if we just sum up the CPU time for the 
existing subprocesses, we may lose the CPU used by the finished subprocesses. 
So our approach is computing the CPU gain each update and cumulate them. In 
this way, even if the subprocess finished, we still get the CPU usage of it.


> Make ProcfsBasedProcessTree collect CPU usage information
> ---------------------------------------------------------
>
>                 Key: MAPREDUCE-1201
>                 URL: https://issues.apache.org/jira/browse/MAPREDUCE-1201
>             Project: Hadoop Map/Reduce
>          Issue Type: Sub-task
>    Affects Versions: 0.22.0
>            Reporter: Scott Chen
>            Assignee: Scott Chen
>             Fix For: 0.22.0
>
>         Attachments: MAPREDUCE-1201.patch
>
>
> This information can be reported back to jobtracker to help profiling jobs 
> and scheduling tasks.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to