Skip to content
Permalink
Browse files

report: use ru_stime for system CPU calculation

PR-URL: #26286
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information...
cjihrig committed Feb 24, 2019
1 parent 084f74a commit 42551909f7c20d6b4c4c6e28695958729177455d
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/node_report.cc
@@ -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;
@@ -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;

0 comments on commit 4255190

Please sign in to comment.
You can’t perform that action at this time.