Skip to content

Commit

Permalink
report: use ru_stime for system CPU calculation
Browse files Browse the repository at this point in the history
PR-URL: #26286
Reviewed-By: Richard Lau <[email protected]>
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
  • Loading branch information
cjihrig authored and addaleax committed Mar 1, 2019
1 parent d2d9453 commit ba5f31a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/node_report.cc
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ static void PrintResourceUsage(JSONWriter* writer) {
double user_cpu =
stats.ru_utime.tv_sec + SEC_PER_MICROS * stats.ru_utime.tv_usec;
double kernel_cpu =
stats.ru_utime.tv_sec + SEC_PER_MICROS * stats.ru_utime.tv_usec;
stats.ru_stime.tv_sec + SEC_PER_MICROS * stats.ru_stime.tv_usec;
writer->json_keyvalue("userCpuSeconds", user_cpu);
writer->json_keyvalue("kernelCpuSeconds", kernel_cpu);
double cpu_abs = user_cpu + kernel_cpu;
Expand All @@ -506,7 +506,7 @@ static void PrintResourceUsage(JSONWriter* writer) {
double user_cpu =
stats.ru_utime.tv_sec + SEC_PER_MICROS * stats.ru_utime.tv_usec;
double kernel_cpu =
stats.ru_utime.tv_sec + SEC_PER_MICROS * stats.ru_utime.tv_usec;
stats.ru_stime.tv_sec + SEC_PER_MICROS * stats.ru_stime.tv_usec;
writer->json_keyvalue("userCpuSeconds", user_cpu);
writer->json_keyvalue("kernelCpuSeconds", kernel_cpu);
double cpu_abs = user_cpu + kernel_cpu;
Expand Down

0 comments on commit ba5f31a

Please sign in to comment.