From 00da834939d7d6c6d3b2d16f8d57fcfd3703d76d 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 --- .../rest/core/services/IdentifierService.java | 2 ++ .../core/services/ServerInfoResponseImpl.java | 18 ++++++++++++++++++ 2 files changed, 20 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 c517fbc0..ed01667a 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 52e6e36e..e3129f68 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 @@ -31,6 +31,7 @@ public class ServerInfoResponseImpl { private String launcherName; private String productId; private String tspVersion; + private String jvmVersion; /** * @return Version in the format Major.Minor.Micro @@ -201,4 +202,21 @@ public void setProductId(String productId) { public void setTspVersion(String version) { tspVersion = version; } + + /** + * Set JVM Version + * + * @param jvmVersion jvm version + */ + public void setJvmVersion(String jvmVersion) { + this.jvmVersion = jvmVersion; + } + + /** + * @return the jvm Version + */ + public String getJvmVersion() { + return jvmVersion; + } + }