Skip to content

Add a flag to return 0 if only one data point has been recorded - #18636

Merged
pshipton merged 1 commit into
eclipse-openj9:masterfrom
thallium:getProcessCpuLoad
Dec 15, 2023
Merged

Add a flag to return 0 if only one data point has been recorded#18636
pshipton merged 1 commit into
eclipse-openj9:masterfrom
thallium:getProcessCpuLoad

Conversation

@thallium

Copy link
Copy Markdown
Contributor

Currently, getProcessCpuLoad() and getSystemCpuLoad() return -1 if only one data point has been recorded. A compatibility flag -XX:[+/-]CpuLoadCompatibility is added to match the behaviour of the RI, which is to return 0.

Fixes: #13389
Related: eclipse-omr/omr#7189
Related: #18634

Currently, getProcessCpuLoad() and getSystemCpuLoad() return -1 if only
one data point has been recorded. A compatibility flag
-XX:[+/-]CpuLoadCompatibility is added to match the behaviour of the RI,
which is to return 0.

Fixes: eclipse-openj9#13389
Related: eclipse-omr/omr#7189

Signed-off-by: Gengchen Tuo <gengchen.tuo@ibm.com>
@thallium

Copy link
Copy Markdown
Contributor Author

FYI @tajila @pshipton

@pshipton
pshipton merged commit 408bdc7 into eclipse-openj9:master Dec 15, 2023
@pshipton

Copy link
Copy Markdown
Member

@thallium don't forget to open the docs issue
https://github.com/eclipse-openj9/openj9-docs/issues/

@pshipton

Copy link
Copy Markdown
Member

@TobiAjila did you want this in 0.43?

@tajila

tajila commented Dec 16, 2023

Copy link
Copy Markdown
Contributor

@TobiAjila did you want this in 0.43?

Yes, lets add to 0.43

@thallium

Copy link
Copy Markdown
Contributor Author

Docs issue has been open eclipse-openj9/openj9-docs#1232. FYI @pshipton @tajila

@pshipton

Copy link
Copy Markdown
Member

@thallium pls cherry pick the commit and create a PR on https://github.com/eclipse-openj9/openj9/tree/v0.43.0-release

@thallium

Copy link
Copy Markdown
Contributor Author

Just found that a comment wasn't updated correctly and there's a minor formatting issue. I will open a PR to fix them first.

thallium added a commit to thallium/openj9 that referenced this pull request Dec 17, 2023
A comment wasn't updated correctly and there's a minor formatting issue in eclipse-openj9#18636

Signed-off-by: Gengchen Tuo <gengchen.tuo@ibm.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

getProcessCpuLoad() always return -1 in first call on jdk11

3 participants