-
Notifications
You must be signed in to change notification settings - Fork 8k
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
system rules support ibm J9 #2709
base: master
Are you sure you want to change the base?
Conversation
yanhom seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
try { | ||
return method != null ? (long) method.invoke(targetObj) : -1; | ||
} catch (Exception e) { | ||
return -1; |
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.
maybe we need print the exeception?
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.
done
try { | ||
return method != null ? (double) method.invoke(targetObj) : Double.NaN; | ||
} catch (Exception e) { | ||
return Double.NaN; |
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.
maybe we need print the exeception?
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.
done
OPERATING_SYSTEM_BEAN_CLASS.cast(OPERATING_SYSTEM_BEAN); | ||
return OPERATING_SYSTEM_BEAN_CLASS.getDeclaredMethod(name); | ||
} catch (Exception e) { | ||
return null; |
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.
maybe we need print the exeception?
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.
done!
* com.sun for HotSpot | ||
*/ | ||
private static final List<String> OPERATING_SYSTEM_BEAN_CLASS_NAMES = Arrays.asList( | ||
"com.sun.management.OperatingSystemMXBean", "com.ibm.lang.management.OperatingSystemMXBean"); |
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.
I think write the target class here is not a good way to extends other JVM. cloud you provide a common way to introduce the OperationSystemMXBean
?
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.
The difference only in the bean class name, treat as a common constant, I think there is no need to design a very abstract
Can this PR be merged? |
Now system metrics are obtained from com.sun.management.OperatingSystemMXBean for HotSpot JVM, but these are in com.ibm.lang.management.OperatingSystemMXBean for Ibm J9, so need to deduce the target source.