-
Notifications
You must be signed in to change notification settings - Fork 396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
omrsysinfo_get_CPU_load() return a new error for insufficient data #7189
Conversation
@tajila FYI |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for supporting the project, and congratulations on your first contribution! A project committer will shortly review your contribution. In the mean time, if you haven't had a chance please skim over the contribution guidelines which all pull requests must adhere to. If the ECA pull request check fails, have a look at the instructions for signing the ECA in the legal considerations section.
If you run into any problems our community will be happy to assist you in any way we can. There are a number of recommended ways to interact with the community. We encourage you to ask questions, or drop by to say hello.
@babsingh Please review these changes |
jenkins build all |
Currently, this PR only updates the |
Also, the function description needs to be updated to reflect the new error handling: |
There is also the |
Why does it says "on the first two invocations"? Is that a typo? |
I am unable to confirm by just reading the below design and implementation; it doesn't seem straightforward.
@thallium Can you verify by adding print statements for the return value in the existing test (see below)? I can run PR builds on all platforms once you have added debug code in the test. |
@fjeremic For #7189 (comment), do you remember why the second invocation of |
@babsingh I've added the debug output, can you run the test? |
jenkins build all(test:'-R porttest',env:'GTEST_FILTER=PortSysinfoTest.sysinfo_test_get_CPU_load',compile:'-j8') If the |
jenkins build all(test:'-R porttest',env:'GTEST_FILTER=PortSysinfoTest.sysinfo_test_get_CPU_load') |
Windows compilation failed:
Test output:
I only checked a few build jobs. I consistently saw the above test output. @thallium Verify the test output in the PR builds as well. Fix the Windows compilation issue and verify the test output on Windows. |
The test output for Windows is also the same:
The second |
I don't think this is fully accurate. The real intent is to return zero if we have one data point instead of -1 as the RI does. This is usually the case on the first call.
Im not certain, ubt I would expect that to be the case. We can try to verify this. For example, if If RI doesn't do this, then they are losing information, because returning 0 when there is a hard failure means there is no way to tell that there is a functional issue. In which case, I would still be okay with the behaviour being proposed here. |
@thallium Please post an update in the PR once the below tasks are completed.
|
RI returns -1 in this situation. |
Thanks @thallium for verifying RI's behaviour. Can you also update the commit message to reflect the new documentation?
|
4897e4a
to
5c4e691
Compare
This is to determine if a call to omrsysinfo_get_CPU_load has only one data point recorded. Also fixed a mistake in the description saying that the first two invocations return OMRPORT_ERROR_OPFAILED and fix the time unit in the description to "ms". Related: eclipse-openj9/openj9#18451 Signed-off-by: Gengchen Tuo <gengchen.tuo@ibm.com>
jenkins build all |
jenkins build aix |
Only a known issue is observed: |
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>
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>
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>
This is to determine if a call to
omrsysinfo_get_CPU_load
has onlyone data point recorded.
A new error,
OMRPORT_ERROR_INSUFFICIENT_DATA
, is returnedin this scenario.
Also fixed a mistake in the description saying that the first two
invocations return
OMRPORT_ERROR_OPFAILED
and fix the time unit in thedescription to
ms
.Related: eclipse-openj9/openj9#18451