Enhance ThreadCPULoadEvent and CPULoadEvent events with the actual elapsed CPU time.
The rationale is that under certain circumstances it is quite difficult to restore the elapsed CPU based on the load percentages - eg. cgroups containers without CPU limit set would report improper number of cores and the derived CPU time would become skewed. Another thing is that in that kind of environment reporting the percentual load also does not really work, thanks to imprecise core number count.
The solution would be to include CPU time values in those events - for ThreadCPULoadEvent we already have all the necessary information but it is not stored in the event fields. For CPULoadEvent the situation is slightly more complex since we are calculating the load based (mostly, OS-dependent) reported ticks and these ticks will need to be converted to nanoseconds.
The rationale is that under certain circumstances it is quite difficult to restore the elapsed CPU based on the load percentages - eg. cgroups containers without CPU limit set would report improper number of cores and the derived CPU time would become skewed. Another thing is that in that kind of environment reporting the percentual load also does not really work, thanks to imprecise core number count.
The solution would be to include CPU time values in those events - for ThreadCPULoadEvent we already have all the necessary information but it is not stored in the event fields. For CPULoadEvent the situation is slightly more complex since we are calculating the load based (mostly, OS-dependent) reported ticks and these ticks will need to be converted to nanoseconds.
- links to
-
Review openjdk/jdk/2186