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

Add some queries for analysing Java EE servers #22

Open
eclipsewebmaster opened this issue May 8, 2024 · 6 comments
Open

Add some queries for analysing Java EE servers #22

eclipsewebmaster opened this issue May 8, 2024 · 6 comments

Comments

@eclipsewebmaster
Copy link

| --- | --- |
| Bugzilla Link | 442217 |
| Status | ASSIGNED |
| Importance | P3 enhancement |
| Reported | Aug 20, 2014 19:41 EDT |
| Modified | Feb 01, 2023 08:10 EDT |
| Depends on | 442219 |
| See also | Gerrit change https://git.eclipse.org/r/63237 |
| Reporter | James Livingston |

Description

It would be good to provide some queries to show Java EE-related data such as HTTP sessions, EJBs/Servlets and so on.

@eclipsewebmaster
Copy link
Author

By James Livingston on Aug 20, 2014 19:42

I have developed some of these queries, and will attach a patch shortly after I restructure it to fit into the main MAT source tree rather than an external one.

@eclipsewebmaster
Copy link
Author

By James Livingston on Aug 24, 2014 22:45

Created attachment 246295
Initial implementation

Attached is an initial version of some Java EE queries. It includes HTTP sessions and session attributes, Servlets and servlet requests and stateful EJBs with support for JBoss EAP 6 (AS7) and Wildfly 8.

I have some other queries locally, but an still porting them to be in the main tree and tidying them up, and wanted to post what I had now to get feedback.

Before (a future version of) this gets committed, I'd like to implement at least some of the extractors for Tomcat/WebSphere/WebLogic/etc to make sure I haven't the SPI JBoss-centric.

Some obvious outstanding work is:

  • Handle messages and i18n properly
  • Review the error handling which is currently "write all SnapshotExceptions to the error log"
  • Review some of the utility methods and see if they better live elsewhere
  • Review package organisation
  • Think about adding tests
  • Add some documentation

There is also a single report which just displays all the new queries. It's pretty simple but can be useful to see likely culprits at a quick glance. It would probably be better to integrate with Leak Suspects.

I have BaseObjectQuery and SimpleObjectQuery as parent classes for the queries to reduce the boilerplate. The queries generally have a top-level "overview" row, optionally a second-level chikd row and then show outgoing references. Comments on those classes definitely welcome. They use a new GraftedResultTree class which grafts another set of results (usually outgoing references) onto child rows. I need to investigate the perforamnce issue with context objects when it's enabled, and fix up some of the text display to look more like normal outgoing references queries.

The *Extractor SPIs are modelled off the extisting Collections ones. The methods aren't well throught out, and are just whatever I wanted to display as columns.

:notepad_spiral: mat-javaee-plugin.diff

@eclipsewebmaster
Copy link
Author

By Krum Tsvetkov on Aug 29, 2014 07:16

James, thanks a lot for the contribution!

I am looking into the code and this will take me some more time.
Meanwhile I found one issue with the patch - some of the files were not properly added:

Index: plugins/org.eclipse.mat.javaee/.classpath
===================================================================
Cannot display: file marked as a binary type.
--
Index: plugins/org.eclipse.mat.javaee/.project
===================================================================
Cannot display: file marked as a binary type.
--
Index: plugins/org.eclipse.mat.javaee/plugin.xml
===================================================================
Cannot display: file marked as a binary type.
--
Index: plugins/org.eclipse.mat.javaee/pom.xml
===================================================================
Cannot display: file marked as a binary type.

I was able to create a new .project and .classpath files, and will be able to create the pom.xml.
However, the plugin.xml is critical. It should contain all the extensions definitions I think.
Can you please check this?

@eclipsewebmaster
Copy link
Author

By James Livingston on Sep 01, 2014 02:14

Created attachment 246585
plugin.xml

I'll rebuild the patch after fixing the svn mime-types when I'm at work tomorrow, but here's the plugin.xml

:notepad_spiral: plugin.xml

@eclipsewebmaster
Copy link
Author

Dec 23, 2015 20:43

New Gerrit change created: https://git.eclipse.org/r/63237

@eclipsewebmaster
Copy link
Author

By Andrew Johnson on Feb 01, 2023 08:10

This is an interesting patch, though sadly we haven't incorporated it yet.

If we were to revive this one then I think we would need to do the following:

  1. Confirm it is still relevant - would the queries still work with modern Java EE implementations?
  2. Follow the Eclipse IP process
    a. Confirm with James that this is original code contributed under the EPL - I think that the license is implied by the headers in some, but not all files. James not longer works for the same employer, so we would need to find him.
    b. Confirm that he was authorised by his employer at the time to submit the code.
    c. Red Hat has signed the Member Committer and Contributor Agreement even if James has not:
    https://www.eclipse.org/projects/handbook/#resources-eca\
    https://www.eclipse.org/membership/showMember.php?member_id=731\
    d. Follow the current Eclipse IP process for large contributions, as there are 4000+ lines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant