From 1122411dc889a2ca61f8ecbd4c85f6742bda0912 Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Fri, 29 Mar 2019 08:24:52 -0400 Subject: [PATCH] Add usage indicators for the bundled JDK (#40616) This commit adds indications whether or not a distribution is from the bundled JDK, and whether or not we are using the bundled JDK. --- distribution/archives/build.gradle | 4 +- distribution/build.gradle | 16 +++-- distribution/packages/build.gradle | 32 +++++----- distribution/src/bin/elasticsearch | 2 + distribution/src/bin/elasticsearch-env | 1 + distribution/src/bin/elasticsearch-env.bat | 1 + .../src/bin/elasticsearch-service.bat | 2 +- distribution/src/bin/elasticsearch.bat | 2 +- docs/reference/cluster/stats.asciidoc | 9 ++- .../cluster/stats/ClusterStatsNodes.java | 8 +++ .../elasticsearch/monitor/jvm/JvmInfo.java | 60 ++++++++++++++++--- .../ClusterStatsMonitoringDocTests.java | 4 ++ 12 files changed, 107 insertions(+), 34 deletions(-) diff --git a/distribution/archives/build.gradle b/distribution/archives/build.gradle index 57463d6a7e287..cb2ed5e791c92 100644 --- a/distribution/archives/build.gradle +++ b/distribution/archives/build.gradle @@ -54,10 +54,10 @@ CopySpec archiveFiles(CopySpec modulesFiles, String distributionType, String pla into('config') { dirMode 0750 fileMode 0660 - with configFiles(distributionType, oss) + with configFiles(distributionType, oss, jdk) } into('bin') { - with binFiles(distributionType, oss) + with binFiles(distributionType, oss, jdk) } if (jdk) { into('jdk') { diff --git a/distribution/build.gradle b/distribution/build.gradle index 9a3ca3e0d8edd..b540e0b85252c 100644 --- a/distribution/build.gradle +++ b/distribution/build.gradle @@ -321,13 +321,13 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { from project(':distribution').buildTransportModules } - configFiles = { distributionType, oss -> + configFiles = { distributionType, oss, jdk -> copySpec { with copySpec { // main config files, processed with distribution specific substitutions from '../src/config' exclude 'log4j2.properties' // this is handled separately below - MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss)) + MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss, jdk)) } if (oss) { from project(':distribution').buildOssLog4jConfig @@ -339,7 +339,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { } } - binFiles = { distributionType, oss -> + binFiles = { distributionType, oss, jdk -> copySpec { // non-windows files, for all distributions with copySpec { @@ -347,7 +347,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { exclude '*.exe' exclude '*.bat' eachFile { it.setMode(0755) } - MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss)) + MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss, jdk)) } // windows files, only for zip if (distributionType == 'zip') { @@ -355,7 +355,7 @@ configure(subprojects.findAll { ['archives', 'packages'].contains(it.name) }) { from '../src/bin' include '*.bat' filter(FixCrLfFilter, eol: FixCrLfFilter.CrLf.newInstance('crlf')) - MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss)) + MavenFilteringHack.filter(it, expansionsForDistribution(distributionType, oss, jdk)) } with copySpec { from '../src/bin' @@ -452,7 +452,7 @@ task run(type: RunTask) { * */ subprojects { - ext.expansionsForDistribution = { distributionType, oss -> + ext.expansionsForDistribution = { distributionType, oss, jdk -> final String defaultHeapSize = "1g" final String packagingPathData = "path.data: /var/lib/elasticsearch" final String pathLogs = "/var/log/elasticsearch" @@ -545,6 +545,10 @@ subprojects { 'zip': 'zip' ], + 'es.bundled_jdk': [ + 'def': jdk ? 'true' : 'false' + ], + 'license.name': [ 'deb': oss ? 'ASL-2.0' : 'Elastic-License' ], diff --git a/distribution/packages/build.gradle b/distribution/packages/build.gradle index a7f178e4b8261..7fd8f03338cdf 100644 --- a/distribution/packages/build.gradle +++ b/distribution/packages/build.gradle @@ -61,23 +61,23 @@ buildscript { } } -void addProcessFilesTask(String type, boolean oss) { - String packagingFiles = "build/packaging/${ oss ? 'oss-' : ''}${type}" +void addProcessFilesTask(String type, boolean oss, boolean jdk) { + String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}" - String taskName = "process${oss ? 'Oss' : ''}${type.capitalize()}Files" + String taskName = "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files" task(taskName, type: Copy) { into packagingFiles with copySpec { from 'src/common' from "src/${type}" - MavenFilteringHack.filter(it, expansionsForDistribution(type, oss)) + MavenFilteringHack.filter(it, expansionsForDistribution(type, oss, jdk)) } into('etc/elasticsearch') { - with configFiles(type, oss) + with configFiles(type, oss, jdk) } - MavenFilteringHack.filter(it, expansionsForDistribution(type, oss)) + MavenFilteringHack.filter(it, expansionsForDistribution(type, oss, jdk)) doLast { // create empty dirs, we set the permissions when configuring the packages @@ -91,17 +91,21 @@ void addProcessFilesTask(String type, boolean oss) { } } } -addProcessFilesTask('deb', true) -addProcessFilesTask('deb', false) -addProcessFilesTask('rpm', true) -addProcessFilesTask('rpm', false) +addProcessFilesTask('deb', true, true) +addProcessFilesTask('deb', true, false) +addProcessFilesTask('deb', false, true) +addProcessFilesTask('deb', false, false) +addProcessFilesTask('rpm', true, true) +addProcessFilesTask('rpm', true, false) +addProcessFilesTask('rpm', false, true) +addProcessFilesTask('rpm', false, false) // Common configuration that is package dependent. This can't go in ospackage // since we have different templated files that need to be consumed, but the structure // is the same Closure commonPackageConfig(String type, boolean oss, boolean jdk) { return { - dependsOn "process${oss ? 'Oss' : ''}${type.capitalize()}Files" + dependsOn "process${oss ? 'Oss' : ''}${jdk ? '' : 'NoJdk'}${type.capitalize()}Files" packageName "elasticsearch${oss ? '-oss' : ''}" arch (type == 'deb' ? 'amd64' : 'X86_64') // Follow elasticsearch's file naming convention @@ -110,7 +114,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) { String prefix = "${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}" destinationDir = file("${prefix}/build/distributions") - String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${type}" + String packagingFiles = "build/packaging/${oss ? 'oss-' : ''}${jdk ? '' : 'no-jdk-'}${type}" String scripts = "${packagingFiles}/scripts" preInstall file("${scripts}/preinst") @@ -125,7 +129,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) { // specify it again explicitly for copying common files into('/usr/share/elasticsearch') { into('bin') { - with binFiles(type, oss) + with binFiles(type, oss, jdk) } from(rootProject.projectDir) { include 'README.textile' @@ -202,7 +206,7 @@ Closure commonPackageConfig(String type, boolean oss, boolean jdk) { createDirectoryEntry true fileType CONFIG | NOREPLACE } - String envFile = expansionsForDistribution(type, false)['path.env'] + String envFile = expansionsForDistribution(type, oss, jdk)['path.env'] configurationFile envFile into(new File(envFile).getParent()) { fileType CONFIG | NOREPLACE diff --git a/distribution/src/bin/elasticsearch b/distribution/src/bin/elasticsearch index 50913fd94fcfa..0a9cc7f98053b 100755 --- a/distribution/src/bin/elasticsearch +++ b/distribution/src/bin/elasticsearch @@ -29,6 +29,7 @@ if ! echo $* | grep -E '(^-d |-d$| -d |--daemonize$|--daemonize )' > /dev/null; -Des.path.conf="$ES_PATH_CONF" \ -Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \ -Des.distribution.type="$ES_DISTRIBUTION_TYPE" \ + -Des.bundled_jdk="$ES_BUNDLED_JDK" \ -cp "$ES_CLASSPATH" \ org.elasticsearch.bootstrap.Elasticsearch \ "$@" @@ -40,6 +41,7 @@ else -Des.path.conf="$ES_PATH_CONF" \ -Des.distribution.flavor="$ES_DISTRIBUTION_FLAVOR" \ -Des.distribution.type="$ES_DISTRIBUTION_TYPE" \ + -Des.bundled_jdk="$ES_BUNDLED_JDK" \ -cp "$ES_CLASSPATH" \ org.elasticsearch.bootstrap.Elasticsearch \ "$@" \ diff --git a/distribution/src/bin/elasticsearch-env b/distribution/src/bin/elasticsearch-env index 0e7f591adace3..2a490622b34b4 100644 --- a/distribution/src/bin/elasticsearch-env +++ b/distribution/src/bin/elasticsearch-env @@ -82,6 +82,7 @@ ES_PATH_CONF=`cd "$ES_PATH_CONF"; pwd` ES_DISTRIBUTION_FLAVOR=${es.distribution.flavor} ES_DISTRIBUTION_TYPE=${es.distribution.type} +ES_BUNDLED_JDK=${es.bundled_jdk} if [ -z "$ES_TMPDIR" ]; then ES_TMPDIR=`"$JAVA" -cp "$ES_CLASSPATH" org.elasticsearch.tools.launchers.TempDirectory` diff --git a/distribution/src/bin/elasticsearch-env.bat b/distribution/src/bin/elasticsearch-env.bat index bfaf56d74661a..1264d116b6a72 100644 --- a/distribution/src/bin/elasticsearch-env.bat +++ b/distribution/src/bin/elasticsearch-env.bat @@ -56,6 +56,7 @@ for %%I in ("%ES_PATH_CONF%..") do set ES_PATH_CONF=%%~dpfI set ES_DISTRIBUTION_FLAVOR=${es.distribution.flavor} set ES_DISTRIBUTION_TYPE=${es.distribution.type} +set ES_BUNDLED_JDK=${es.bundled_jdk} if not defined ES_TMPDIR ( for /f "tokens=* usebackq" %%a in (`"%JAVA% -cp "!ES_CLASSPATH!" "org.elasticsearch.tools.launchers.TempDirectory""`) do set ES_TMPDIR=%%a diff --git a/distribution/src/bin/elasticsearch-service.bat b/distribution/src/bin/elasticsearch-service.bat index fc62c07ac9d3c..dc25d12b1b99c 100644 --- a/distribution/src/bin/elasticsearch-service.bat +++ b/distribution/src/bin/elasticsearch-service.bat @@ -164,7 +164,7 @@ if "%JVM_SS%" == "" ( goto:eof ) -set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%";-Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%";-Des.distribution.type="%ES_DISTRIBUTION_TYPE%" +set ES_PARAMS=-Delasticsearch;-Des.path.home="%ES_HOME%";-Des.path.conf="%ES_PATH_CONF%";-Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%";-Des.distribution.type="%ES_DISTRIBUTION_TYPE%";-Des.bundled_jdk="%ES_BUNDLED_JDK%" if "%ES_START_TYPE%" == "" set ES_START_TYPE=manual if "%ES_STOP_TIMEOUT%" == "" set ES_STOP_TIMEOUT=0 diff --git a/distribution/src/bin/elasticsearch.bat b/distribution/src/bin/elasticsearch.bat index 975af52e39523..7df6f19fc0765 100644 --- a/distribution/src/bin/elasticsearch.bat +++ b/distribution/src/bin/elasticsearch.bat @@ -50,7 +50,7 @@ if "%MAYBE_JVM_OPTIONS_PARSER_FAILED%" == "jvm_options_parser_failed" ( exit /b 1 ) -%JAVA% %ES_JAVA_OPTS% -Delasticsearch -Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" -Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%" -Des.distribution.type="%ES_DISTRIBUTION_TYPE%" -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams! +%JAVA% %ES_JAVA_OPTS% -Delasticsearch -Des.path.home="%ES_HOME%" -Des.path.conf="%ES_PATH_CONF%" -Des.distribution.flavor="%ES_DISTRIBUTION_FLAVOR%" -Des.distribution.type="%ES_DISTRIBUTION_TYPE%" -Des.bundled_jd="%ES_BUNDLED_JDK%" -cp "%ES_CLASSPATH%" "org.elasticsearch.bootstrap.Elasticsearch" !newparams! endlocal endlocal diff --git a/docs/reference/cluster/stats.asciidoc b/docs/reference/cluster/stats.asciidoc index 83515e32bf046..38028d8cf109f 100644 --- a/docs/reference/cluster/stats.asciidoc +++ b/docs/reference/cluster/stats.asciidoc @@ -155,10 +155,12 @@ Will return, for example: "max_uptime_in_millis": 13737, "versions": [ { - "version": "1.8.0_74", - "vm_name": "Java HotSpot(TM) 64-Bit Server VM", - "vm_version": "25.74-b02", + "version": "12", + "vm_name": "OpenJDK 64-Bit Server VM", + "vm_version": "12+33", "vm_vendor": "Oracle Corporation", + "bundled_jdk": true, + "using_bundled_jdk": true, "count": 1 } ], @@ -200,6 +202,7 @@ Will return, for example: // TESTRESPONSE[s/"plugins": \[[^\]]*\]/"plugins": $body.$_path/] // TESTRESPONSE[s/"network_types": \{[^\}]*\}/"network_types": $body.$_path/] // TESTRESPONSE[s/"discovery_types": \{[^\}]*\}/"discovery_types": $body.$_path/] +// TESTRESPONSE[s/: true|false/: $body.$_path/] // TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$_path/] // TESTRESPONSE[s/: "[^"]*"/: $body.$_path/] // These replacements do a few things: diff --git a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java index 6597cdf30f5e7..3b3fa480326ae 100644 --- a/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java +++ b/server/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsNodes.java @@ -502,6 +502,8 @@ static final class Fields { static final String VM_NAME = "vm_name"; static final String VM_VERSION = "vm_version"; static final String VM_VENDOR = "vm_vendor"; + static final String BUNDLED_JDK = "bundled_jdk"; + static final String USING_BUNDLED_JDK = "using_bundled_jdk"; static final String COUNT = "count"; static final String THREADS = "threads"; static final String MAX_UPTIME = "max_uptime"; @@ -524,6 +526,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) builder.field(Fields.VM_NAME, v.key.vmName); builder.field(Fields.VM_VERSION, v.key.vmVersion); builder.field(Fields.VM_VENDOR, v.key.vmVendor); + builder.field(Fields.BUNDLED_JDK, v.key.bundledJdk); + builder.field(Fields.USING_BUNDLED_JDK, v.key.usingBundledJdk); builder.field(Fields.COUNT, v.value); builder.endObject(); } @@ -543,12 +547,16 @@ public static class JvmVersion { String vmName; String vmVersion; String vmVendor; + boolean bundledJdk; + Boolean usingBundledJdk; JvmVersion(JvmInfo jvmInfo) { version = jvmInfo.version(); vmName = jvmInfo.getVmName(); vmVersion = jvmInfo.getVmVersion(); vmVendor = jvmInfo.getVmVendor(); + bundledJdk = jvmInfo.getBundledJdk(); + usingBundledJdk = jvmInfo.getUsingBundledJdk(); } @Override diff --git a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java index f24acc9c034e9..e8380a77962d4 100644 --- a/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java +++ b/server/src/main/java/org/elasticsearch/monitor/jvm/JvmInfo.java @@ -19,6 +19,10 @@ package org.elasticsearch.monitor.jvm; +import org.elasticsearch.Version; +import org.elasticsearch.common.Booleans; +import org.elasticsearch.common.SuppressForbidden; +import org.elasticsearch.common.io.PathUtils; import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.io.stream.Writeable; @@ -150,10 +154,24 @@ public class JvmInfo implements Writeable, ToXContentFragment { } + final boolean bundledJdk = Booleans.parseBoolean(System.getProperty("es.bundled_jdk", Boolean.FALSE.toString())); + final Boolean usingBundledJdk = bundledJdk ? usingBundledJdk() : null; + INSTANCE = new JvmInfo(JvmPid.getPid(), System.getProperty("java.version"), runtimeMXBean.getVmName(), runtimeMXBean.getVmVersion(), - runtimeMXBean.getVmVendor(), runtimeMXBean.getStartTime(), configuredInitialHeapSize, configuredMaxHeapSize, - mem, inputArguments, bootClassPath, classPath, systemProperties, gcCollectors, memoryPools, onError, onOutOfMemoryError, - useCompressedOops, useG1GC, useSerialGC); + runtimeMXBean.getVmVendor(), bundledJdk, usingBundledJdk, runtimeMXBean.getStartTime(), configuredInitialHeapSize, + configuredMaxHeapSize, mem, inputArguments, bootClassPath, classPath, systemProperties, gcCollectors, memoryPools, onError, + onOutOfMemoryError, useCompressedOops, useG1GC, useSerialGC); + } + + @SuppressForbidden(reason = "PathUtils#get") + private static boolean usingBundledJdk() { + /* + * We are using the bundled JDK if java.home is the jdk sub-directory of our working directory. This is because we always set + * the working directory of Elasticsearch to home, and the bundled JDK is in the jdk sub-directory there. + */ + final String javaHome = System.getProperty("java.home"); + final String userDir = System.getProperty("user.dir"); + return PathUtils.get(javaHome).equals(PathUtils.get(userDir).resolve("jdk").toAbsolutePath()); } public static JvmInfo jvmInfo() { @@ -170,6 +188,8 @@ public static JvmInfo jvmInfo() { private final String vmName; private final String vmVersion; private final String vmVendor; + private final boolean bundledJdk; + private final Boolean usingBundledJdk; private final long startTime; private final long configuredInitialHeapSize; private final long configuredMaxHeapSize; @@ -186,15 +206,18 @@ public static JvmInfo jvmInfo() { private final String useG1GC; private final String useSerialGC; - private JvmInfo(long pid, String version, String vmName, String vmVersion, String vmVendor, long startTime, - long configuredInitialHeapSize, long configuredMaxHeapSize, Mem mem, String[] inputArguments, String bootClassPath, - String classPath, Map systemProperties, String[] gcCollectors, String[] memoryPools, String onError, - String onOutOfMemoryError, String useCompressedOops, String useG1GC, String useSerialGC) { + private JvmInfo(long pid, String version, String vmName, String vmVersion, String vmVendor, boolean bundledJdk, Boolean usingBundledJdk, + long startTime, long configuredInitialHeapSize, long configuredMaxHeapSize, Mem mem, String[] inputArguments, + String bootClassPath, String classPath, Map systemProperties, String[] gcCollectors, + String[] memoryPools, String onError, String onOutOfMemoryError, String useCompressedOops, String useG1GC, + String useSerialGC) { this.pid = pid; this.version = version; this.vmName = vmName; this.vmVersion = vmVersion; this.vmVendor = vmVendor; + this.bundledJdk = bundledJdk; + this.usingBundledJdk = usingBundledJdk; this.startTime = startTime; this.configuredInitialHeapSize = configuredInitialHeapSize; this.configuredMaxHeapSize = configuredMaxHeapSize; @@ -218,6 +241,13 @@ public JvmInfo(StreamInput in) throws IOException { vmName = in.readString(); vmVersion = in.readString(); vmVendor = in.readString(); + if (in.getVersion().onOrAfter(Version.V_7_0_0)) { + bundledJdk = in.readBoolean(); + usingBundledJdk = in.readOptionalBoolean(); + } else { + bundledJdk = false; + usingBundledJdk = null; + } startTime = in.readLong(); inputArguments = new String[in.readInt()]; for (int i = 0; i < inputArguments.length; i++) { @@ -246,6 +276,10 @@ public void writeTo(StreamOutput out) throws IOException { out.writeString(vmName); out.writeString(vmVersion); out.writeString(vmVendor); + if (out.getVersion().onOrAfter(Version.V_7_0_0)) { + out.writeBoolean(bundledJdk); + out.writeOptionalBoolean(usingBundledJdk); + } out.writeLong(startTime); out.writeInt(inputArguments.length); for (String inputArgument : inputArguments) { @@ -360,6 +394,14 @@ public String getVmVendor() { return this.vmVendor; } + public boolean getBundledJdk() { + return bundledJdk; + } + + public Boolean getUsingBundledJdk() { + return usingBundledJdk; + } + public long getStartTime() { return this.startTime; } @@ -436,6 +478,8 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws builder.field(Fields.VM_NAME, vmName); builder.field(Fields.VM_VERSION, vmVersion); builder.field(Fields.VM_VENDOR, vmVendor); + builder.field(Fields.BUNDLED_JDK, bundledJdk); + builder.field(Fields.USING_BUNDLED_JDK, usingBundledJdk); builder.timeField(Fields.START_TIME_IN_MILLIS, Fields.START_TIME, startTime); builder.startObject(Fields.MEM); @@ -464,6 +508,8 @@ static final class Fields { static final String VM_NAME = "vm_name"; static final String VM_VERSION = "vm_version"; static final String VM_VENDOR = "vm_vendor"; + static final String BUNDLED_JDK = "bundled_jdk"; + static final String USING_BUNDLED_JDK = "using_bundled_jdk"; static final String START_TIME = "start_time"; static final String START_TIME_IN_MILLIS = "start_time_in_millis"; diff --git a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java index fbb923c3f2f69..e436484bceba4 100644 --- a/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java +++ b/x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/collector/cluster/ClusterStatsMonitoringDocTests.java @@ -265,6 +265,8 @@ public void testToXContent() throws IOException { when(mockJvmInfo.getVmName()).thenReturn("_jvm_vm_name"); when(mockJvmInfo.getVmVersion()).thenReturn("_jvm_vm_version"); when(mockJvmInfo.getVmVendor()).thenReturn("_jvm_vm_vendor"); + when(mockJvmInfo.getBundledJdk()).thenReturn(true); + when(mockJvmInfo.getUsingBundledJdk()).thenReturn(true); final NodeStats mockNodeStats = mock(NodeStats.class); when(mockNodeStats.getTimestamp()).thenReturn(0L); @@ -481,6 +483,8 @@ public void testToXContent() throws IOException { + "\"vm_name\":\"_jvm_vm_name\"," + "\"vm_version\":\"_jvm_vm_version\"," + "\"vm_vendor\":\"_jvm_vm_vendor\"," + + "\"bundled_jdk\":true," + + "\"using_bundled_jdk\":true," + "\"count\":1" + "}" + "],"