From 1a79fbeb68ed7918b0ea1fe9e3bf8b4541ecb26b Mon Sep 17 00:00:00 2001 From: Matthew Khouzam Date: Fri, 22 Nov 2024 09:16:14 -0500 Subject: [PATCH] Add jvm version to identifier service Can help for diagnosis/debugging [Added] JVM version to identifier service Signed-off-by: Matthew Khouzam Change-Id: Id3a59648b2389f7d143586107e0ac1718cda2c46 --- .../rest/core/services/IdentifierService.java | 2 ++ .../core/services/ServerInfoResponseImpl.java | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/IdentifierService.java b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/IdentifierService.java index 1634cc056..8d226c4f6 100644 --- a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/IdentifierService.java +++ b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/IdentifierService.java @@ -41,6 +41,7 @@ public class IdentifierService { private static final String OS_NAME = "os.name"; //$NON-NLS-1$ private static final String OS_ARCH = "os.arch"; //$NON-NLS-1$ private static final String OS_VERSION = "os.version"; //$NON-NLS-1$ + private static final String JVM_VERSION = "java.version"; //$NON-NLS-1$ private static final String PRODUCT_ID = "eclipse.product"; //$NON-NLS-1$ private static final String LAUNCHER_NAME = "eclipse.launcher.name"; //$NON-NLS-1$ private static final String QUALIFIER = "qualifier"; //$NON-NLS-1$ @@ -69,6 +70,7 @@ public Response getSystemInfo() { response.setMaxMemory(Runtime.getRuntime().maxMemory()); response.setProductId(System.getProperty(PRODUCT_ID)); response.setLauncherName(System.getProperty(LAUNCHER_NAME)); + response.setJvmVersion(System.getProperty(JVM_VERSION)); if (product != null) { Version version = product.getDefiningBundle().getVersion(); diff --git a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ServerInfoResponseImpl.java b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ServerInfoResponseImpl.java index 742362fbd..7787fead0 100644 --- a/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ServerInfoResponseImpl.java +++ b/trace-server/org.eclipse.tracecompass.incubator.trace.server.jersey.rest.core/src/org/eclipse/tracecompass/incubator/internal/trace/server/jersey/rest/core/services/ServerInfoResponseImpl.java @@ -30,6 +30,7 @@ public class ServerInfoResponseImpl { @JsonInclude(JsonInclude.Include.NON_NULL) // Makes launcher name optional private String launcherName; private String productId; + private String jvmVersion; /** * @return Version in the format Major.Minor.Micro @@ -184,4 +185,20 @@ public void setProductId(String productId) { this.productId = productId; } + /** + * Set JVM Version + * + * @param jvmVersion jvm version + */ + public void setJvmVersion(String jvmVersion) { + this.jvmVersion = jvmVersion; + } + + /** + * @return the jvm Version + */ + public String getJvmVersion() { + return jvmVersion; + } + }