Skip to content

Commit

Permalink
fix process cputime accounting
Browse files Browse the repository at this point in the history
  • Loading branch information
nguu0123 committed Jun 5, 2024
1 parent df77ed2 commit 65cd0c4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion qoa4ml_lib/qoa4ml/utils/qoa_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,13 @@ def report_proc_child_cpu(process: psutil.Process):
child_processes_cpu[f"child_{id}"] = float(cpu_time.user + cpu_time.system)

total_cpu_usage = sum(child_processes_cpu.values())
total_cpu_usage += float(process_cpu_time.user + process_cpu_time.system)
total_cpu_usage += float(
process_cpu_time.user
+ process_cpu_time.system
+ process_cpu_time.children_user
+ process_cpu_time.children_system
)

return {
"child_process": child_processes_count,
"value": child_processes_cpu,
Expand Down

0 comments on commit 65cd0c4

Please sign in to comment.