On Thu, 27 May 2021 00:47:23 GMT, Yasumasa Suenaga <ysuen...@openjdk.org> wrote:

> `getCpuLoad()` has been based on total time since the start of the container, 
> but after this PR, it is based on the ticks in earlier call. Is it ok?
> IMHO it can be accepted because it is the same with load average on Linux, 
> but I concern we may need CSR because this PR changes behavior.

@YaSuenag Thanks for your comment. I can give two reasons for that.
1. The javadoc of `OperatingSystemMXBean.getCpuLoad` indicates the method 
should return "recent cpu usage".
https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/jdk.management/share/classes/com/sun/management/OperatingSystemMXBean.java#L156
2. The initial (container-unaware) implementation `getCpuLoad0` does reports 
recent CPU load, which the container-aware implementation must be consistent.

> but after this PR, it is based on the ticks in earlier call. Is it ok?

The result might be too coarse/inaccurate, if the time between two calls is too 
long/short. Any comments for that?

-------------

PR: https://git.openjdk.java.net/jdk/pull/3656

Reply via email to