Skip to content
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

Merged
merged 6 commits into from
Jul 10, 2024
Merged

Support jsr77 j2ee statistics #531

merged 6 commits into from
Jul 10, 2024

Conversation

amarziali
Copy link
Contributor

This PR allows fetching JSR-77 JEE Management statistic mbeans used in many application servers (jboss, weblogic, ...) to represent resources like ThreadPools.

@amarziali amarziali requested a review from a team as a code owner June 26, 2024 15:42
@amarziali amarziali marked this pull request as draft June 26, 2024 15:54
@amarziali amarziali force-pushed the andrea.marziali/jsr-77 branch from 88848bb to 624c956 Compare June 26, 2024 18:37
@amarziali amarziali marked this pull request as ready for review June 26, 2024 18:39
@amarziali amarziali marked this pull request as draft June 26, 2024 19:15
@amarziali amarziali marked this pull request as ready for review June 27, 2024 07:43
@amarziali amarziali marked this pull request as draft June 27, 2024 12:33
@amarziali amarziali marked this pull request as ready for review July 3, 2024 07:45
@amarziali amarziali requested a review from mcculls July 3, 2024 07:45
@mcculls mcculls requested a review from carlosroman July 3, 2024 21:12

private static final Logger LOGGER = LoggerFactory.getLogger(JeeStatisticsAttributes.class);
private static final WeakHashMap<ClassLoader, ReflectionHolder> REFLECTION_CACHE =
new WeakHashMap<>();
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Contributor

@mcculls mcculls left a 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

@amarziali amarziali requested a review from mcculls July 4, 2024 20:44
@carlosroman
Copy link
Contributor

Tested a local build of your branch @amarziali and all working fine:

=========
JMX Fetch
=========

  Information
  ==================
    runtime_version : 11.0.22
    version : 0.49.3-SNAPSHOT
  Initialized checks
  ==================
    kafka
    - instance_name: kafka-kafka-v2-9999
      metric_count: 68
      service_check_count: 0
      message: <no value>
      status: OK
  Failed checks
  =============
    no checks

@carlosroman carlosroman merged commit 9030283 into master Jul 10, 2024
9 checks passed
@carlosroman carlosroman deleted the andrea.marziali/jsr-77 branch July 10, 2024 09:48
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.

3 participants