Bug 442217 - Add some queries for analysing Java EE servers
Summary: Add some queries for analysing Java EE servers
Status: CLOSED MOVED
Alias: None
Product: MAT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Krum Tsvetkov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 442219
Blocks:
  Show dependency tree
 
Reported: 2014-08-20 19:41 EDT by James Livingston CLA
Modified: 2024-05-08 14:48 EDT (History)
3 users (show)

See Also:


Attachments
Initial implementation (117.89 KB, patch)
2014-08-24 22:45 EDT, James Livingston CLA
no flags Details | Diff
plugin.xml (904 bytes, text/xml)
2014-09-01 02:14 EDT, James Livingston CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description James Livingston CLA 2014-08-20 19:41:44 EDT
It would be good to provide some queries to show Java EE-related data such as HTTP sessions, EJBs/Servlets and so on.
Comment 1 James Livingston CLA 2014-08-20 19:42:38 EDT
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.
Comment 2 James Livingston CLA 2014-08-24 22:45:50 EDT
Created attachment 246295 [details]
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.
Comment 3 Krum Tsvetkov CLA 2014-08-29 07:16:36 EDT
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?
Comment 4 James Livingston CLA 2014-09-01 02:14:19 EDT
Created attachment 246585 [details]
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
Comment 5 Eclipse Genie CLA 2015-12-23 20:43:25 EST
New Gerrit change created: https://git.eclipse.org/r/63237
Comment 6 Andrew Johnson CLA 2023-02-01 08:10:47 EST
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.
Comment 7 Eclipse Webmaster CLA 2024-05-08 14:48:27 EDT
This issue has been migrated to https://github.com/eclipse-mat/org.eclipse.mat/issues/22.