Repository navigation
Conversation
|
@jasonk000 @krumts Hey guys, if you have a chance, please review. Example output (snippet): |
1. Add a new API AIDetailsProvider class that may be optionally set in a query's getResultMetaData. 1. Bump MAT to 1.18.0 for the new API. 1. Add an AIDetailsProvider to the ThreadOverviewQuery so that 2 depths of the tree are exported including all stack frames and all stack frame locals. 1. Add a new AITextOutputter and associated export button (Export to TXT for AI...). Uses the extension .text to differentiate it from the old TextOutputter that uses .txt. AITextOutputter inherits from TextOutputter and is largely the same with the addition of a prefix to help prompt AI consumers by explaining the format of the output (e.g. nesting with pipe character prefixes) and optionally an additional prefix through AIDetailsProvider to further prompt AI consumers by explaining the output. 1. The other differences between AITextOutputter and TextOutputter are dictated by the logic in ExportActions: the totals row is suppressed as that adds a lot of fluff especially with expanded rows, and, most importantly, check if the ResultMetaData includes a non-default tree export depth. By default, we don't expand trees. Unlike the TextOutputter, the AITextOutputter ignores current expansion in the Tree and always has a uniform output. 1. I installed a fresh Eclipse 2026-06 and after loading the project and without doing anything, lots of Eclipse .project, .classpath, .prefs, etc. files were updated. I reviewed the updates and they seemed benign/reasonable, so I guess since we're still keeping Eclipse project files checked in, I'm guessing it's reasonable to commit all of these changes. I'm not sure why Eclipse changed org.eclipse.jdt.core.compiler.release from enabled to disabled. 1. Add a test that checks that the AITextOutputter works and includes the thread overview query prefix in its output. Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
|
@kgibm , I haven't looked in detail yet - but I suggest we name it "Export to Markdown (.md)" or similar, and emit standard markdown. Markdown is lingua franca standard text format for AI tooling. |
|
That seems reasonable although will require some larger changes. I don't think Markdown has a concept of nested tables (for
|
jasonk000
left a comment
There was a problem hiding this comment.
Mostly, looks OK - only question is are we missing a null check at at result.getMetadata(), and should the file list include .txt?.
| @@ -0,0 +1,4 @@ | |||
| activeProfiles= | |||
There was a problem hiding this comment.
This and related files, to 1.18 bump, are required for this PR?
There was a problem hiding this comment.
Yeah because of the new addAIDetailsProvider method added to the ResultMetaData API
| </projects> | ||
| <buildSpec> | ||
| <buildCommand> | ||
| <name>org.eclipse.m2e.core.maven2Builder</name> |
There was a problem hiding this comment.
Should be different PR, not blocking.
There was a problem hiding this comment.
These changes came as part of the newer Eclipse automatically. They seem benign as far as I can tell
| org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning | ||
| org.eclipse.jdt.core.compiler.release=disabled | ||
| org.eclipse.jdt.core.compiler.source=1.8 | ||
| org.eclipse.jdt.core.compiler.release=enabled |
There was a problem hiding this comment.
We could align these across all plugins -- any reason not to? Not sure if J9 impact.
There was a problem hiding this comment.
Sure, I see no reason not to switch everything explicitly over to Java 21
| eclipse.preferences.version=1 | ||
| org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 | ||
| org.eclipse.jdt.core.compiler.compliance=1.8 | ||
| org.eclipse.jdt.core.compiler.codegen.targetPlatform=17 |
There was a problem hiding this comment.
Similar here, we could make them all 21 for consistency unless there is a blocker.
| @Override | ||
| public void embedd(Context context, IResult result, Writer writer) throws IOException | ||
| { | ||
| AIDetailsProvider aiDetailsProvider = result.getResultMetaData().getAIDetailsProvider(); |
There was a problem hiding this comment.
Null check required here for result.getResultMetadata().
| { | ||
| ExportDialog dialog = new ExportDialog(control.getShell(), // | ||
| new String[] { Messages.ExportActions_PlainAiText }, // | ||
| new String[] { "*.text" });//$NON-NLS-1$ |
There was a problem hiding this comment.
this is a bit odd to me, should be .txt, or both .txt and .text? :)
There was a problem hiding this comment.
I'm about to commit new changes and it'll be .md
|
re: Markdown nested. Good point that it does not support nested tables. I looked online, this stackoverflow says that we should put html inside md table cell, but that does not seem like an improvement in end user readability. |
|
Thanks @jasonk000 for the review. I do still plan on converting this PR to markdown but just haven't found the cycles yet. Do you think it's okay to use nested bulleted list to simulate the table? HTML tables would work but one of the use cases I wanted for this was a simple, human-readable output (as well as LLM readable). |
Yes I think bullets are a good choice. If it is for human + LLM consumption (vs structured like CSV!) then we have flexibility too. The structure can be tweaked over time as well, since the reader (human or LLM) can adapt. |
Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>
|
PR updated with new
Export of a list of all known threads and key metadata such as the thread name, if available in the dump. In addition, if available in the dump, nested below each thread is a list of the stack frames of the thread at the time of the dump and below each stack frame, each stack frame local actively referenced by that stack frame.
The following Eclipse Memory Analyzer Tool markdown output represents a tree of result data from a query. Each root element in the tree is represented by a bulleted list item. If a tree item has children, then each child will be a bulleted list item with an additional level of indentation logically underneath that item. Each tree item is printed as a comma separated list of column name and value pairs separated by a colon.
* Object / Stack Frame: org.eclipse.osgi.framework.eventmgr.EventManager$EventThread @ 0x600805b58, Name: Start Level: Equinox Container: 4ed5060b-ff91-4852-a83b-ec794e84c2a8, Shallow Heap: 120, Retained Heap: 4,952, Context Class Loader: org.eclipse.osgi.internal.framework.ContextFinder @ 0x6001448b0, Is Daemon: true, Priority: 5, State: [alive, in object wait, waiting, waiting indefinitely], State value: 0x191
* Object / Stack Frame: at java.lang.Object.wait0(J)V (Object.java(Native Method))
* Object / Stack Frame: at java.lang.Object.wait(J)V (Object.java:366)
* Object / Stack Frame: at java.lang.Object.wait()V (Object.java:339)
* Object / Stack Frame: at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.getNextEvent()Lorg/eclipse/osgi/framework/eventmgr/EventManager$EventThread$Queued; (EventManager.java:396), Max. Locals' Retained Heap: 4,952
* Object / Stack Frame: org.eclipse.osgi.framework.eventmgr.EventManager$EventThread @ 0x600805b58 Start Level: Equinox Container: 4ed5060b-ff91-4852-a83b-ec794e84c2a8, Shallow Heap: 120, Retained Heap: 4,952
* Object / Stack Frame: at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run()V (EventManager.java:337), Max. Locals' Retained Heap: 4,952
* Object / Stack Frame: org.eclipse.osgi.framework.eventmgr.EventManager$EventThread @ 0x600805b58 Start Level: Equinox Container: 4ed5060b-ff91-4852-a83b-ec794e84c2a8, Shallow Heap: 120, Retained Heap: 4,952 |
Signed-off-by: Kevin Grigorenko <kevin.grigorenko@us.ibm.com>

Fixes #192