RFR: 8265836: OperatingSystemImpl.getCpuLoad() returns incorrect CPU load inside a container [v4]
Hao Tang
github.com+7947546+tanghaoth90 at openjdk.java.net
Tue May 25 21:46:51 UTC 2021
On Tue, 25 May 2021 09:53:02 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:
>> Hao Tang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Fix compile errors on MacOS
>
> Bumping number of required reviewers to 2 as I'm a contributing author of the change.
@jerboaa Thank you for the cpu-shares-based load calculation! I also update the cpu-quota-based load calculation to use the same strategy as the cpu-shares-based one, because my previous implementation always reports the average load since the container starts.
Another change is to set the initial value of `usageTicks`/`totalTicks` to zero. Therefore, the first call of `getCpuLoad` can also report a reasonable result.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3656
More information about the serviceability-dev
mailing list