-
Notifications
You must be signed in to change notification settings - Fork 70
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
Support jsr77 j2ee statistics #531
Conversation
88848bb
to
624c956
Compare
|
||
private static final Logger LOGGER = LoggerFactory.getLogger(JeeStatisticsAttributes.class); | ||
private static final WeakHashMap<ClassLoader, ReflectionHolder> REFLECTION_CACHE = | ||
new WeakHashMap<>(); |
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 suspect this won't work as intended in terms of unloading, because the values in the map contain class references from the class-loader, and those will stop the class-loader from being unloaded. We could wrap the values in a SoftReference
to avoid pinning the class-loader while allowing the value to carry over across GC cycles.
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.
Wrapped around a softreference. Thank you for the suggestion. I completely missed this
src/main/java/org/datadog/jmxfetch/util/JeeStatisticsAttributes.java
Outdated
Show resolved
Hide resolved
src/main/java/org/datadog/jmxfetch/util/JeeStatisticsAttributes.java
Outdated
Show resolved
Hide resolved
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.
Some minor suggestions - otherwise this looks good
Tested a local build of your branch @amarziali and all working fine:
|
This PR allows fetching JSR-77 JEE Management statistic mbeans used in many application servers (jboss, weblogic, ...) to represent resources like ThreadPools.