wspy – added on_cpu and on_core metrics
wspy is now enhanced to provide two new metrics, for a particular process tree:
- on_cpu – what percentage of the total time are all the cores scheduled to run in either user or system time?
- on_core – what percentage of the total time would a single core be busy?
A quick example for openssl is shown below:
[3359] cpu=6 elapsed=20.04 on_cpu=1.00 on_core=7.99 user=0.00 system=0.00 vsize=4592k openssl pcount=10 [3360] cpu=2 elapsed=20.04 on_cpu=1.00 on_core=7.99 user=0.00 system=0.00 vsize=16500k openssl pcount=9 [3361] cpu=1 elapsed=20.03 on_cpu=0.12 on_core=1.00 user=20.03 system=0.00 vsize=16632k openssl pcount=1 [3362] cpu=4 elapsed=20.02 on_cpu=0.12 on_core=1.00 user=20.00 system=0.00 vsize=16632k openssl pcount=1 [3363] cpu=3 elapsed=20.03 on_cpu=0.12 on_core=1.00 user=20.02 system=0.00 vsize=16632k openssl pcount=1 [3364] cpu=2 elapsed=20.02 on_cpu=0.12 on_core=1.00 user=20.02 system=0.00 vsize=16632k openssl pcount=1 [3365] cpu=5 elapsed=20.03 on_cpu=0.12 on_core=1.00 user=20.01 system=0.00 vsize=16632k openssl pcount=1 [3366] cpu=7 elapsed=20.02 on_cpu=0.12 on_core=1.00 user=20.01 system=0.00 vsize=16632k openssl pcount=1 [3367] cpu=6 elapsed=20.03 on_cpu=0.12 on_core=1.00 user=20.02 system=0.00 vsize=16632k openssl pcount=1 [3368] cpu=0 elapsed=20.04 on_cpu=0.12 on_core=1.00 user=20.02 system=0.00 vsize=16632k openssl pcount=1
It basically shows that each of pid 3361 to pid 3368 run for ~20 seconds and are marked as 100% user time on their respective cores. As a result, for the duration of the parent process (3360), this process and its children keep the CPU marked 100% busy and are the equivalent of being scheduler 7.99 cores worth of time.
In contrast, the process tree for x264 is shown below:
[6670] cpu=2 elapsed=16.66 on_cpu=0.71 on_core=5.71 user=0.00 system=0.00 vsize=4592k x264 pcount=12 [6671] cpu=6 elapsed=16.66 on_cpu=0.71 on_core=5.71 user=0.94 system=0.12 vsize=445796k x264 pcount=11 [6672] cpu=2 elapsed=16.53 on_cpu=0.00 on_core=0.00 user=0.00 system=0.02 vsize=453992k x264 pcount=1 [6673] cpu=5 elapsed=16.53 on_cpu=0.07 on_core=0.56 user=9.19 system=0.02 vsize=1225676k x264 pcount=1 [6674] cpu=3 elapsed=16.53 on_cpu=0.08 on_core=0.64 user=10.61 system=0.03 vsize=1225676k x264 pcount=1 [6675] cpu=6 elapsed=16.53 on_cpu=0.06 on_core=0.49 user=8.00 system=0.02 vsize=1225676k x264 pcount=1 [6676] cpu=4 elapsed=16.53 on_cpu=0.09 on_core=0.73 user=12.09 system=0.02 vsize=1225676k x264 pcount=1 [6677] cpu=7 elapsed=16.53 on_cpu=0.08 on_core=0.61 user=10.05 system=0.00 vsize=1225676k x264 pcount=1 [6678] cpu=2 elapsed=16.53 on_cpu=0.06 on_core=0.51 user=8.42 system=0.02 vsize=1225676k x264 pcount=1 [6679] cpu=1 elapsed=16.53 on_cpu=0.09 on_core=0.72 user=11.82 system=0.03 vsize=1225676k x264 pcount=1 [6680] cpu=0 elapsed=16.53 on_cpu=0.08 on_core=0.64 user=10.65 system=0.01 vsize=1225676k x264 pcount=1 [6681] cpu=6 elapsed=15.48 on_cpu=0.11 on_core=0.84 user=13.08 system=0.00 vsize=1233228k x264 pcount=1
For the duration of the ~16.53 seconds that processes 6672 to 6681 are running, they are scheduled on core between 0% (6672) and 84% (6681) of the time. For the entire duration, the CPU runs for equivalent of 5.71 cores or 71% of the time. The remaining 29% is something else, e.g. idle time, overhead, some other process.
Comments
wspy – added on_cpu and on_core metrics — No Comments
HTML tags allowed in your comment: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>