diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/AbstractCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/AbstractCollector.java index 5727b1a0668..499775c3484 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/AbstractCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/AbstractCollector.java @@ -54,9 +54,13 @@ public abstract class AbstractCollector extends AbstractLifecycleComponent return false; } + protected boolean localNodeMaster() { + return clusterService.state().nodes().localNodeMaster(); + } + @Override public Collection collect() { - if (masterOnly() && !clusterService.state().nodes().localNodeMaster()) { + if (masterOnly() && !localNodeMaster()) { logger.trace("collector [{}] runs on master only", name()); return null; } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollector.java index 8b73faf7856..f096ce016f3 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollector.java @@ -7,7 +7,6 @@ package org.elasticsearch.marvel.agent.collector.cluster; import com.google.common.collect.ImmutableList; import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse; -import org.elasticsearch.action.admin.cluster.health.ClusterHealthStatus; import org.elasticsearch.client.Client; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.ClusterState; @@ -50,11 +49,7 @@ public class ClusterStateCollector extends AbstractCollector { +public class ClusterStateMarvelDoc extends MarvelDoc { - private final Payload payload; + private final ClusterState clusterState; + private final ClusterHealthStatus status; - public ClusterStateMarvelDoc(String clusterUUID, String type, long timestamp, Payload payload) { + public ClusterStateMarvelDoc(String clusterUUID, String type, long timestamp, ClusterState clusterState, ClusterHealthStatus status) { super(clusterUUID, type, timestamp); - this.payload = payload; + this.clusterState = clusterState; + this.status = status; } - @Override - public ClusterStateMarvelDoc.Payload payload() { - return payload; + public ClusterState getClusterState() { + return clusterState; } - public static ClusterStateMarvelDoc createMarvelDoc(String clusterUUID, String type, long timestamp, ClusterState clusterState, ClusterHealthStatus status) { - return new ClusterStateMarvelDoc(clusterUUID, type, timestamp, new Payload(clusterState, status)); - } - - public static class Payload { - - private final ClusterState clusterState; - private final ClusterHealthStatus status; - - Payload(ClusterState clusterState, ClusterHealthStatus status) { - this.clusterState = clusterState; - this.status = status; - } - - public ClusterState getClusterState() { - return clusterState; - } - - public ClusterHealthStatus getStatus() { - return status; - } + public ClusterHealthStatus getStatus() { + return status; } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java index f63be411acf..77ac6c07da3 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollector.java @@ -46,11 +46,7 @@ public class ClusterStatsCollector extends AbstractCollector results = ImmutableList.builder(); ClusterStatsResponse clusterStatsResponse = client.admin().cluster().prepareClusterStats().get(marvelSettings.clusterStatsTimeout()); - results.add(buildMarvelDoc(clusterUUID(), TYPE, System.currentTimeMillis(), clusterStatsResponse)); + results.add(new ClusterStatsMarvelDoc(clusterUUID(), TYPE, System.currentTimeMillis(), clusterStatsResponse)); return results.build(); } - - protected MarvelDoc buildMarvelDoc(String clusterUUID, String type, long timestamp, ClusterStatsResponse clusterStatsResponse) { - return ClusterStatsMarvelDoc.createMarvelDoc(clusterUUID, type, timestamp, clusterStatsResponse); - } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsMarvelDoc.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsMarvelDoc.java index a19f78b1bb4..7e27241e39d 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsMarvelDoc.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsMarvelDoc.java @@ -8,34 +8,16 @@ package org.elasticsearch.marvel.agent.collector.cluster; import org.elasticsearch.action.admin.cluster.stats.ClusterStatsResponse; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; -public class ClusterStatsMarvelDoc extends MarvelDoc { +public class ClusterStatsMarvelDoc extends MarvelDoc { - private final Payload payload; + private final ClusterStatsResponse clusterStats; - public ClusterStatsMarvelDoc(String clusterUUID, String type, long timestamp, Payload payload) { + public ClusterStatsMarvelDoc(String clusterUUID, String type, long timestamp, ClusterStatsResponse clusterStats) { super(clusterUUID, type, timestamp); - this.payload = payload; + this.clusterStats = clusterStats; } - @Override - public ClusterStatsMarvelDoc.Payload payload() { - return payload; - } - - public static ClusterStatsMarvelDoc createMarvelDoc(String clusterUUID, String type, long timestamp, ClusterStatsResponse clusterStats) { - return new ClusterStatsMarvelDoc(clusterUUID, type, timestamp, new Payload(clusterStats)); - } - - public static class Payload { - - private final ClusterStatsResponse clusterStats; - - Payload(ClusterStatsResponse clusterStats) { - this.clusterStats = clusterStats; - } - - public ClusterStatsResponse getClusterStats() { - return clusterStats; - } + public ClusterStatsResponse getClusterStats() { + return clusterStats; } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollector.java index 0f3fdf00485..7c5366c4ce6 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollector.java @@ -53,12 +53,8 @@ public class IndexRecoveryCollector extends AbstractCollector { +public class IndexRecoveryMarvelDoc extends MarvelDoc { - private final Payload payload; + private final RecoveryResponse recoveryResponse; - public IndexRecoveryMarvelDoc(String clusterUUID, String type, long timestamp, Payload payload) { + public IndexRecoveryMarvelDoc(String clusterUUID, String type, long timestamp, RecoveryResponse recoveryResponse) { super(clusterUUID, type, timestamp); - this.payload = payload; + this.recoveryResponse = recoveryResponse; } - @Override - public IndexRecoveryMarvelDoc.Payload payload() { - return payload; - } - - public static IndexRecoveryMarvelDoc createMarvelDoc(String clusterUUID, String type, long timestamp, - RecoveryResponse recoveryResponse) { - return new IndexRecoveryMarvelDoc(clusterUUID, type, timestamp, new Payload(recoveryResponse)); - } - - public static class Payload { - - RecoveryResponse recoveryResponse; - - public Payload(RecoveryResponse recoveryResponse) { - this.recoveryResponse = recoveryResponse; - } - - public RecoveryResponse getRecoveryResponse() { - return recoveryResponse; - } - + public RecoveryResponse getRecoveryResponse() { + return recoveryResponse; } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollector.java index f322a63f245..0fcd6aa4687 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollector.java @@ -56,12 +56,8 @@ public class IndexStatsCollector extends AbstractCollector long timestamp = System.currentTimeMillis(); String clusterUUID = clusterUUID(); for (IndexStats indexStats : indicesStats.getIndices().values()) { - results.add(buildMarvelDoc(clusterUUID, TYPE, timestamp, indexStats)); + results.add(new IndexStatsMarvelDoc(clusterUUID, TYPE, timestamp, indexStats)); } return results.build(); } - - protected MarvelDoc buildMarvelDoc(String clusterUUID, String type, long timestamp, IndexStats indexStats) { - return IndexStatsMarvelDoc.createMarvelDoc(clusterUUID, type, timestamp, indexStats); - } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsMarvelDoc.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsMarvelDoc.java index 5da9ca2818a..2005035c0e0 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsMarvelDoc.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsMarvelDoc.java @@ -8,34 +8,16 @@ package org.elasticsearch.marvel.agent.collector.indices; import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; -public class IndexStatsMarvelDoc extends MarvelDoc { +public class IndexStatsMarvelDoc extends MarvelDoc { - private final Payload payload; + private final IndexStats indexStats; - public IndexStatsMarvelDoc(String clusterUUID, String type, long timestamp, Payload payload) { + public IndexStatsMarvelDoc(String clusterUUID, String type, long timestamp, IndexStats indexStats) { super(clusterUUID, type, timestamp); - this.payload = payload; + this.indexStats = indexStats; } - @Override - public IndexStatsMarvelDoc.Payload payload() { - return payload; - } - - public static IndexStatsMarvelDoc createMarvelDoc(String clusterUUID, String type, long timestamp, IndexStats indexStats) { - return new IndexStatsMarvelDoc(clusterUUID, type, timestamp, new Payload(indexStats)); - } - - public static class Payload { - - private final IndexStats indexStats; - - Payload(IndexStats indexStats) { - this.indexStats = indexStats; - } - - public IndexStats getIndexStats() { - return indexStats; - } + public IndexStats getIndexStats() { + return indexStats; } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesCollector.java index a1fc6ca8ce5..34236c420d5 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesCollector.java @@ -50,7 +50,7 @@ public class LicensesCollector extends AbstractCollector { List licenses = licenseService.licenses(); if (licenses != null) { String clusterUUID = clusterUUID(); - results.add(LicensesMarvelDoc.createMarvelDoc(MarvelSettings.MARVEL_DATA_INDEX_NAME, TYPE, clusterUUID, clusterUUID, System.currentTimeMillis(), + results.add(new LicensesMarvelDoc(MarvelSettings.MARVEL_DATA_INDEX_NAME, TYPE, clusterUUID, clusterUUID, System.currentTimeMillis(), clusterName.value(), Version.CURRENT.toString(), licenses)); } return results.build(); diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesMarvelDoc.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesMarvelDoc.java index 630ef0bf4c5..1b148acb0ad 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesMarvelDoc.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/licenses/LicensesMarvelDoc.java @@ -10,46 +10,30 @@ import org.elasticsearch.marvel.agent.exporter.MarvelDoc; import java.util.List; -public class LicensesMarvelDoc extends MarvelDoc { +public class LicensesMarvelDoc extends MarvelDoc { - private final Payload payload; + private final String clusterName; + private final String version; + private final List licenses; - LicensesMarvelDoc(String index, String type, String id, String clusterUUID, long timestamp, Payload payload) { + LicensesMarvelDoc(String index, String type, String id, String clusterUUID, long timestamp, + String clusterName, String version, List licenses) { super(index, type, id, clusterUUID, timestamp); - this.payload = payload; + this.clusterName = clusterName; + this.version = version; + this.licenses = licenses; } - @Override - public LicensesMarvelDoc.Payload payload() { - return payload; + public String getClusterName() { + return clusterName; } - public static LicensesMarvelDoc createMarvelDoc(String index, String type, String id, String clusterUUID, long timestamp, String clusterName, String version, List licenses) { - return new LicensesMarvelDoc(index, type, id, clusterUUID, timestamp, new Payload(clusterName, version, licenses)); + public String getVersion() { + return version; } - public static class Payload { - - private final String clusterName; - private final String version; - private final List licenses; - - public Payload(String clusterName, String version, List licenses) { - this.clusterName = clusterName; - this.version = version; - this.licenses = licenses; - } - - public String getClusterName() { - return clusterName; - } - - public String getVersion() { - return version; - } - - public List getLicenses() { - return licenses; - } + public List getLicenses() { + return licenses; } + } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollector.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollector.java index 535153464c8..e88a9439eeb 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollector.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollector.java @@ -70,16 +70,10 @@ public class NodeStatsCollector extends AbstractCollector { Double diskThresholdWatermarkHigh = (diskThresholdDecider != null) ? 100.0 - diskThresholdDecider.getFreeDiskThresholdHigh() : -1; boolean diskThresholdDeciderEnabled = (diskThresholdDecider != null) && diskThresholdDecider.isEnabled(); - results.add(buildMarvelDoc(clusterUUID(), TYPE, System.currentTimeMillis(), - discoveryService.localNode().id(), clusterService.state().nodes().localNodeMaster(), nodeStats, + results.add(new NodeStatsMarvelDoc(clusterUUID(), TYPE, System.currentTimeMillis(), + discoveryService.localNode().id(), localNodeMaster(), nodeStats, Bootstrap.isMemoryLocked(), diskThresholdWatermarkHigh, diskThresholdDeciderEnabled)); return results.build(); } - - protected MarvelDoc buildMarvelDoc(String clusterUUID, String type, long timestamp, - String nodeId, boolean nodeMaster, NodeStats nodeStats, - boolean mlockall, Double diskThresholdWaterMarkHigh, boolean diskThresholdDeciderEnabled) { - return NodeStatsMarvelDoc.createMarvelDoc(clusterUUID, type, timestamp, nodeId, nodeMaster, nodeStats, mlockall, diskThresholdWaterMarkHigh, diskThresholdDeciderEnabled); - } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsMarvelDoc.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsMarvelDoc.java index 5af6faf807c..71b2fdca1bf 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsMarvelDoc.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsMarvelDoc.java @@ -8,68 +8,49 @@ package org.elasticsearch.marvel.agent.collector.node; import org.elasticsearch.action.admin.cluster.node.stats.NodeStats; import org.elasticsearch.marvel.agent.exporter.MarvelDoc; -public class NodeStatsMarvelDoc extends MarvelDoc { +public class NodeStatsMarvelDoc extends MarvelDoc { - private final Payload payload; + private final String nodeId; + private final boolean nodeMaster; + private final NodeStats nodeStats; - public NodeStatsMarvelDoc(String clusterUUID, String type, long timestamp, Payload payload) { + private final boolean mlockall; + private final Double diskThresholdWaterMarkHigh; + private final boolean diskThresholdDeciderEnabled; + + public NodeStatsMarvelDoc(String clusterUUID, String type, long timestamp, + String nodeId, boolean nodeMaster, NodeStats nodeStats, boolean mlockall, Double diskThresholdWaterMarkHigh, boolean diskThresholdDeciderEnabled) { super(clusterUUID, type, timestamp); - this.payload = payload; + this.nodeId = nodeId; + this.nodeMaster = nodeMaster; + this.nodeStats = nodeStats; + this.mlockall = mlockall; + this.diskThresholdWaterMarkHigh = diskThresholdWaterMarkHigh; + this.diskThresholdDeciderEnabled = diskThresholdDeciderEnabled; } - @Override - public Payload payload() { - return payload; + public String getNodeId() { + return nodeId; } - public static NodeStatsMarvelDoc createMarvelDoc(String clusterUUID, String type, long timestamp, - String nodeId, boolean nodeMaster, NodeStats nodeStats, - boolean mlockall, Double diskThresholdWaterMarkHigh, boolean diskThresholdDeciderEnabled) { - return new NodeStatsMarvelDoc(clusterUUID, type, timestamp, new Payload(nodeId, nodeMaster, nodeStats, mlockall, diskThresholdWaterMarkHigh, diskThresholdDeciderEnabled)); + public boolean isNodeMaster() { + return nodeMaster; } - public static class Payload { + public NodeStats getNodeStats() { + return nodeStats; + } - private final String nodeId; - private final boolean nodeMaster; - private final NodeStats nodeStats; + public boolean isMlockall() { + return mlockall; + } - private final boolean mlockall; - private final Double diskThresholdWaterMarkHigh; - private final boolean diskThresholdDeciderEnabled; + public Double getDiskThresholdWaterMarkHigh() { + return diskThresholdWaterMarkHigh; + } - Payload(String nodeId, boolean nodeMaster, NodeStats nodeStats, boolean mlockall, Double diskThresholdWaterMarkHigh, boolean diskThresholdDeciderEnabled) { - this.nodeId = nodeId; - this.nodeMaster = nodeMaster; - this.nodeStats = nodeStats; - this.mlockall = mlockall; - this.diskThresholdWaterMarkHigh = diskThresholdWaterMarkHigh; - this.diskThresholdDeciderEnabled = diskThresholdDeciderEnabled; - } - - public String getNodeId() { - return nodeId; - } - - public boolean isNodeMaster() { - return nodeMaster; - } - - public NodeStats getNodeStats() { - return nodeStats; - } - - public boolean isMlockall() { - return mlockall; - } - - public Double getDiskThresholdWaterMarkHigh() { - return diskThresholdWaterMarkHigh; - } - - public boolean isDiskThresholdDeciderEnabled() { - return diskThresholdDeciderEnabled; - } + public boolean isDiskThresholdDeciderEnabled() { + return diskThresholdDeciderEnabled; } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MarvelDoc.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MarvelDoc.java index 0614c4d0a0f..6cde2b216d6 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MarvelDoc.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/exporter/MarvelDoc.java @@ -5,7 +5,7 @@ */ package org.elasticsearch.marvel.agent.exporter; -public abstract class MarvelDoc { +public abstract class MarvelDoc { private final String index; private final String type; @@ -45,6 +45,4 @@ public abstract class MarvelDoc { public long timestamp() { return timestamp; } - - public abstract T payload(); } \ No newline at end of file diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRenderer.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRenderer.java index 25f213cd2fa..fe9249742b0 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRenderer.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRenderer.java @@ -36,25 +36,22 @@ public class ClusterStateRenderer extends AbstractRenderer shards = routingTable.allShards(); - if (shards != null) { + RoutingTable routingTable = clusterState.routingTable(); + if (routingTable != null) { + List shards = routingTable.allShards(); + if (shards != null) { - builder.startArray(Fields.SHARDS); - for (ShardRouting shard : shards) { - shard.toXContent(builder, params); - } - builder.endArray(); + builder.startArray(Fields.SHARDS); + for (ShardRouting shard : shards) { + shard.toXContent(builder, params); } + builder.endArray(); } } } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRenderer.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRenderer.java index f5553608abe..24e4d57ee3e 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRenderer.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRenderer.java @@ -37,12 +37,9 @@ public class ClusterStatsRenderer extends AbstractRenderer> shards = recovery.shardResponses(); - if (shards != null) { - for (Map.Entry> shard : shards.entrySet()) { + RecoveryResponse recovery = marvelDoc.getRecoveryResponse(); + if (recovery != null) { + builder.startArray(Fields.SHARDS); + Map> shards = recovery.shardResponses(); + if (shards != null) { + for (Map.Entry> shard : shards.entrySet()) { - List indexShards = shard.getValue(); - if (indexShards != null) { - for (ShardRecoveryResponse indexShard : indexShards) { - builder.startObject(); - builder.field(Fields.INDEX_NAME, shard.getKey()); - indexShard.toXContent(builder, params); - builder.endObject(); - } + List indexShards = shard.getValue(); + if (indexShards != null) { + for (ShardRecoveryResponse indexShard : indexShards) { + builder.startObject(); + builder.field(Fields.INDEX_NAME, shard.getKey()); + indexShard.toXContent(builder, params); + builder.endObject(); } } } - builder.endArray(); } + builder.endArray(); } + builder.endObject(); } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRenderer.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRenderer.java index 5c7936df949..aa850b05e0a 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRenderer.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRenderer.java @@ -40,25 +40,23 @@ public class IndexStatsRenderer extends AbstractRenderer { protected void doRender(IndexStatsMarvelDoc marvelDoc, XContentBuilder builder, ToXContent.Params params) throws IOException { builder.startObject(Fields.INDEX_STATS); - IndexStatsMarvelDoc.Payload payload = marvelDoc.payload(); - if (payload != null) { - IndexStats indexStats = payload.getIndexStats(); - if (indexStats != null) { - builder.field(Fields.INDEX, indexStats.getIndex()); + IndexStats indexStats = marvelDoc.getIndexStats(); + if (indexStats != null) { + builder.field(Fields.INDEX, indexStats.getIndex()); - builder.startObject(Fields.TOTAL); - if (indexStats.getTotal() != null) { - indexStats.getTotal().toXContent(builder, params); - } - builder.endObject(); - - builder.startObject(Fields.PRIMARIES); - if (indexStats.getPrimaries() != null) { - indexStats.getPrimaries().toXContent(builder, params); - } - builder.endObject(); + builder.startObject(Fields.TOTAL); + if (indexStats.getTotal() != null) { + indexStats.getTotal().toXContent(builder, params); } + builder.endObject(); + + builder.startObject(Fields.PRIMARIES); + if (indexStats.getPrimaries() != null) { + indexStats.getPrimaries().toXContent(builder, params); + } + builder.endObject(); } + builder.endObject(); } diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/licenses/LicensesRenderer.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/licenses/LicensesRenderer.java index fea92468d0b..be2ea9f3fde 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/licenses/LicensesRenderer.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/licenses/LicensesRenderer.java @@ -26,32 +26,29 @@ public class LicensesRenderer extends AbstractRenderer { @Override protected void doRender(LicensesMarvelDoc marvelDoc, XContentBuilder builder, ToXContent.Params params) throws IOException { - LicensesMarvelDoc.Payload payload = marvelDoc.payload(); - if (payload != null) { - builder.field(Fields.CLUSTER_NAME, payload.getClusterName()); - builder.field(Fields.VERSION, payload.getVersion()); - builder.startArray(Fields.LICENSES); + builder.field(Fields.CLUSTER_NAME, marvelDoc.getClusterName()); + builder.field(Fields.VERSION, marvelDoc.getVersion()); + builder.startArray(Fields.LICENSES); - List licenses = payload.getLicenses(); - if (licenses != null) { - for (License license : licenses) { - builder.startObject(); - builder.field(Fields.STATUS, status(license)); - builder.field(Fields.UID, license.uid()); - builder.field(Fields.TYPE, license.type()); - builder.dateValueField(Fields.ISSUE_DATE_IN_MILLIS, Fields.ISSUE_DATE, license.issueDate()); - builder.field(Fields.FEATURE, license.feature()); - builder.dateValueField(Fields.EXPIRY_DATE_IN_MILLIS, Fields.EXPIRY_DATE, license.expiryDate()); - builder.field(Fields.MAX_NODES, license.maxNodes()); - builder.field(Fields.ISSUED_TO, license.issuedTo()); - builder.field(Fields.ISSUER, license.issuer()); - builder.field(Fields.HKEY, hash(license, payload.getClusterName())); - builder.endObject(); - } + List licenses = marvelDoc.getLicenses(); + if (licenses != null) { + for (License license : licenses) { + builder.startObject(); + builder.field(Fields.STATUS, status(license)); + builder.field(Fields.UID, license.uid()); + builder.field(Fields.TYPE, license.type()); + builder.dateValueField(Fields.ISSUE_DATE_IN_MILLIS, Fields.ISSUE_DATE, license.issueDate()); + builder.field(Fields.FEATURE, license.feature()); + builder.dateValueField(Fields.EXPIRY_DATE_IN_MILLIS, Fields.EXPIRY_DATE, license.expiryDate()); + builder.field(Fields.MAX_NODES, license.maxNodes()); + builder.field(Fields.ISSUED_TO, license.issuedTo()); + builder.field(Fields.ISSUER, license.issuer()); + builder.field(Fields.HKEY, hash(license, marvelDoc.getClusterName())); + builder.endObject(); } - builder.endArray(); } + builder.endArray(); } // TODO (tlrx): move status as a calculated getter in License class then remove this method diff --git a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRenderer.java b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRenderer.java index 283cad08cb2..ed4cce4e9f4 100644 --- a/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRenderer.java +++ b/marvel/src/main/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRenderer.java @@ -56,20 +56,17 @@ public class NodeStatsRenderer extends AbstractRenderer { protected void doRender(NodeStatsMarvelDoc marvelDoc, XContentBuilder builder, ToXContent.Params params) throws IOException { builder.startObject(Fields.NODE_STATS); - NodeStatsMarvelDoc.Payload payload = marvelDoc.payload(); - if (payload != null) { + builder.field(Fields.NODE_ID, marvelDoc.getNodeId()); + builder.field(Fields.NODE_MASTER, marvelDoc.isNodeMaster()); + builder.field(Fields.MLOCKALL, marvelDoc.isMlockall()); + builder.field(Fields.DISK_THRESHOLD_ENABLED, marvelDoc.isDiskThresholdDeciderEnabled()); + builder.field(Fields.DISK_THRESHOLD_WATERMARK_HIGH, marvelDoc.getDiskThresholdWaterMarkHigh()); - builder.field(Fields.NODE_ID, payload.getNodeId()); - builder.field(Fields.NODE_MASTER, payload.isNodeMaster()); - builder.field(Fields.MLOCKALL, payload.isMlockall()); - builder.field(Fields.DISK_THRESHOLD_ENABLED, payload.isDiskThresholdDeciderEnabled()); - builder.field(Fields.DISK_THRESHOLD_WATERMARK_HIGH, payload.getDiskThresholdWaterMarkHigh()); - - NodeStats nodeStats = payload.getNodeStats(); - if (nodeStats != null) { - nodeStats.toXContent(builder, params); - } + NodeStats nodeStats = marvelDoc.getNodeStats(); + if (nodeStats != null) { + nodeStats.toXContent(builder, params); } + builder.endObject(); } diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java index eb9c34f6f10..d373743e4f2 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStateCollectorTests.java @@ -34,12 +34,9 @@ public class ClusterStateCollectorTests extends ESSingleNodeTestCase { assertThat(clusterStateMarvelDoc.clusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); assertThat(clusterStateMarvelDoc.timestamp(), greaterThan(0L)); assertThat(clusterStateMarvelDoc.type(), equalTo(ClusterStateCollector.TYPE)); + assertNotNull(clusterStateMarvelDoc.getClusterState()); - ClusterStateMarvelDoc.Payload payload = clusterStateMarvelDoc.payload(); - assertNotNull(payload); - assertNotNull(payload.getClusterState()); - - ClusterState clusterState = payload.getClusterState(); + ClusterState clusterState = clusterStateMarvelDoc.getClusterState(); assertThat(clusterState.getRoutingTable().allShards(), hasSize(0)); } @@ -67,11 +64,9 @@ public class ClusterStateCollectorTests extends ESSingleNodeTestCase { assertThat(clusterStateMarvelDoc.timestamp(), greaterThan(0L)); assertThat(clusterStateMarvelDoc.type(), equalTo(ClusterStateCollector.TYPE)); - ClusterStateMarvelDoc.Payload payload = clusterStateMarvelDoc.payload(); - assertNotNull(payload); - assertNotNull(payload.getClusterState()); + assertNotNull(clusterStateMarvelDoc.getClusterState()); - ClusterState clusterState = payload.getClusterState(); + ClusterState clusterState = clusterStateMarvelDoc.getClusterState(); assertThat(clusterState.getRoutingTable().allShards("test"), hasSize(nbShards)); } @@ -105,12 +100,9 @@ public class ClusterStateCollectorTests extends ESSingleNodeTestCase { assertThat(clusterStateMarvelDoc.clusterUUID(), equalTo(client().admin().cluster().prepareState().setMetaData(true).get().getState().metaData().clusterUUID())); assertThat(clusterStateMarvelDoc.timestamp(), greaterThan(0L)); assertThat(clusterStateMarvelDoc.type(), equalTo(ClusterStateCollector.TYPE)); + assertNotNull(clusterStateMarvelDoc.getClusterState()); - ClusterStateMarvelDoc.Payload payload = clusterStateMarvelDoc.payload(); - assertNotNull(payload); - assertNotNull(payload.getClusterState()); - - ClusterState clusterState = payload.getClusterState(); + ClusterState clusterState = clusterStateMarvelDoc.getClusterState(); for (int i = 0; i < nbIndices; i++) { assertThat(clusterState.getRoutingTable().allShards("test-" + i), hasSize(shardsPerIndex[i])); } diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java index 2b5933d9682..901a95fee3b 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/cluster/ClusterStatsCollectorTests.java @@ -32,10 +32,8 @@ public class ClusterStatsCollectorTests extends ESIntegTestCase { assertThat(clusterStatsMarvelDoc.timestamp(), greaterThan(0L)); assertThat(clusterStatsMarvelDoc.type(), equalTo(ClusterStatsCollector.TYPE)); - ClusterStatsMarvelDoc.Payload payload = clusterStatsMarvelDoc.payload(); - assertNotNull(payload); - assertNotNull(payload.getClusterStats()); - assertThat(payload.getClusterStats().getNodesStats().getCounts().getTotal(), equalTo(internalCluster().getNodeNames().length)); + assertNotNull(clusterStatsMarvelDoc.getClusterStats()); + assertThat(clusterStatsMarvelDoc.getClusterStats().getNodesStats().getCounts().getTotal(), equalTo(internalCluster().getNodeNames().length)); } private ClusterStatsCollector newClusterStatsCollector() { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java index e01b8fe93de..875a69b9619 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexRecoveryCollectorTests.java @@ -99,10 +99,7 @@ public class IndexRecoveryCollectorTests extends ESIntegTestCase { assertThat(indexRecoveryMarvelDoc.timestamp(), greaterThan(0L)); assertThat(indexRecoveryMarvelDoc.type(), equalTo(IndexRecoveryCollector.TYPE)); - IndexRecoveryMarvelDoc.Payload payload = indexRecoveryMarvelDoc.payload(); - assertNotNull(payload); - - RecoveryResponse recovery = payload.getRecoveryResponse(); + RecoveryResponse recovery = indexRecoveryMarvelDoc.getRecoveryResponse(); assertNotNull(recovery); Map> shards = recovery.shardResponses(); diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java index 427d6f946b8..fb3180f99fb 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/indices/IndexStatsCollectorTests.java @@ -7,6 +7,7 @@ package org.elasticsearch.marvel.agent.collector.indices; import com.google.common.collect.ImmutableSet; import org.apache.lucene.util.LuceneTestCase; +import org.elasticsearch.action.admin.indices.stats.IndexStats; import org.elasticsearch.cluster.ClusterService; import org.elasticsearch.cluster.block.ClusterBlock; import org.elasticsearch.common.settings.Settings; @@ -56,17 +57,16 @@ public class IndexStatsCollectorTests extends ESSingleNodeTestCase { assertThat(indexStatsMarvelDoc.timestamp(), greaterThan(0L)); assertThat(indexStatsMarvelDoc.type(), equalTo(IndexStatsCollector.TYPE)); - IndexStatsMarvelDoc.Payload payload = indexStatsMarvelDoc.payload(); - assertNotNull(payload); - assertNotNull(payload.getIndexStats()); + IndexStats indexStats = indexStatsMarvelDoc.getIndexStats(); + assertNotNull(indexStats); - assertThat(payload.getIndexStats().getIndex(), equalTo("test")); - assertThat(payload.getIndexStats().getTotal().getDocs().getCount(), equalTo((long) nbDocs)); - assertNotNull(payload.getIndexStats().getTotal().getStore()); - assertThat(payload.getIndexStats().getTotal().getStore().getSizeInBytes(), greaterThan(0L)); - assertThat(payload.getIndexStats().getTotal().getStore().getThrottleTime().millis(), equalTo(0L)); - assertNotNull(payload.getIndexStats().getTotal().getIndexing()); - assertThat(payload.getIndexStats().getTotal().getIndexing().getTotal().getThrottleTimeInMillis(), equalTo(0L)); + assertThat(indexStats.getIndex(), equalTo("test")); + assertThat(indexStats.getTotal().getDocs().getCount(), equalTo((long) nbDocs)); + assertNotNull(indexStats.getTotal().getStore()); + assertThat(indexStats.getTotal().getStore().getSizeInBytes(), greaterThan(0L)); + assertThat(indexStats.getTotal().getStore().getThrottleTime().millis(), equalTo(0L)); + assertNotNull(indexStats.getTotal().getIndexing()); + assertThat(indexStats.getTotal().getIndexing().getTotal().getThrottleTimeInMillis(), equalTo(0L)); } @Test @@ -101,23 +101,21 @@ public class IndexStatsCollectorTests extends ESSingleNodeTestCase { assertThat(marvelDoc, instanceOf(IndexStatsMarvelDoc.class)); IndexStatsMarvelDoc indexStatsMarvelDoc = (IndexStatsMarvelDoc) marvelDoc; + IndexStats indexStats = indexStatsMarvelDoc.getIndexStats(); + assertNotNull(indexStats); - IndexStatsMarvelDoc.Payload payload = indexStatsMarvelDoc.payload(); - assertNotNull(payload); - assertNotNull(payload.getIndexStats()); - - if (payload.getIndexStats().getIndex().equals("test-" + i)) { + if (indexStats.getIndex().equals("test-" + i)) { assertThat(indexStatsMarvelDoc.clusterUUID(), equalTo(clusterUUID)); assertThat(indexStatsMarvelDoc.timestamp(), greaterThan(0L)); assertThat(indexStatsMarvelDoc.type(), equalTo(IndexStatsCollector.TYPE)); - assertNotNull(payload.getIndexStats().getTotal().getDocs()); - assertThat(payload.getIndexStats().getTotal().getDocs().getCount(), equalTo((long) docsPerIndex[i])); - assertNotNull(payload.getIndexStats().getTotal().getStore()); - assertThat(payload.getIndexStats().getTotal().getStore().getSizeInBytes(), greaterThan(0L)); - assertThat(payload.getIndexStats().getTotal().getStore().getThrottleTime().millis(), equalTo(0L)); - assertNotNull(payload.getIndexStats().getTotal().getIndexing()); - assertThat(payload.getIndexStats().getTotal().getIndexing().getTotal().getThrottleTimeInMillis(), equalTo(0L)); + assertNotNull(indexStats.getTotal().getDocs()); + assertThat(indexStats.getTotal().getDocs().getCount(), equalTo((long) docsPerIndex[i])); + assertNotNull(indexStats.getTotal().getStore()); + assertThat(indexStats.getTotal().getStore().getSizeInBytes(), greaterThan(0L)); + assertThat(indexStats.getTotal().getStore().getThrottleTime().millis(), equalTo(0L)); + assertNotNull(indexStats.getTotal().getIndexing()); + assertThat(indexStats.getTotal().getIndexing().getTotal().getThrottleTimeInMillis(), equalTo(0L)); found = true; } } diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java index 5ba54a11969..30da449ec53 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/collector/node/NodeStatsCollectorTests.java @@ -40,15 +40,13 @@ public class NodeStatsCollectorTests extends ESIntegTestCase { assertThat(nodeStatsMarvelDoc.timestamp(), greaterThan(0L)); assertThat(nodeStatsMarvelDoc.type(), equalTo(NodeStatsCollector.TYPE)); - NodeStatsMarvelDoc.Payload payload = nodeStatsMarvelDoc.payload(); - assertNotNull(payload); - assertThat(payload.getNodeId(), equalTo(internalCluster().getInstance(DiscoveryService.class, node).localNode().id())); - assertThat(payload.isNodeMaster(), equalTo(node.equals(internalCluster().getMasterName()))); - assertThat(payload.isMlockall(), equalTo(Bootstrap.isMemoryLocked())); - assertNotNull(payload.isDiskThresholdDeciderEnabled()); - assertNotNull(payload.getDiskThresholdWaterMarkHigh()); + assertThat(nodeStatsMarvelDoc.getNodeId(), equalTo(internalCluster().getInstance(DiscoveryService.class, node).localNode().id())); + assertThat(nodeStatsMarvelDoc.isNodeMaster(), equalTo(node.equals(internalCluster().getMasterName()))); + assertThat(nodeStatsMarvelDoc.isMlockall(), equalTo(Bootstrap.isMemoryLocked())); + assertNotNull(nodeStatsMarvelDoc.isDiskThresholdDeciderEnabled()); + assertNotNull(nodeStatsMarvelDoc.getDiskThresholdWaterMarkHigh()); - assertNotNull(payload.getNodeStats()); + assertNotNull(nodeStatsMarvelDoc.getNodeStats()); } } diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java index 62bdf7c6f6d..594b8c9dc36 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/exporter/HttpESExporterTests.java @@ -220,7 +220,7 @@ public class HttpESExporterTests extends ESIntegTestCase { } private MarvelDoc newRandomMarvelDoc() { - return IndexStatsMarvelDoc.createMarvelDoc(internalCluster().getClusterName(), "test_marvelDoc", timeStampGenerator.incrementAndGet(), + return new IndexStatsMarvelDoc(internalCluster().getClusterName(), "test_marvelDoc", timeStampGenerator.incrementAndGet(), new IndexStats("test_index", null)); } diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java index cc82b2388e9..da4c35807f1 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStateRendererTests.java @@ -36,7 +36,7 @@ public class ClusterStateRendererTests extends ESSingleNodeTestCase { ClusterHealthResponse clusterHealth = client().admin().cluster().prepareHealth().get(); logger.debug("--> creating the cluster state marvel document"); - ClusterStateMarvelDoc marvelDoc = ClusterStateMarvelDoc.createMarvelDoc("test", "marvel_cluster_state", 1437580442979L, + ClusterStateMarvelDoc marvelDoc = new ClusterStateMarvelDoc("test", "marvel_cluster_state", 1437580442979L, clusterState, clusterHealth.getStatus()); logger.debug("--> rendering the document"); diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java index 5a56e497fe2..f9197699988 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/cluster/ClusterStatsRendererTests.java @@ -25,7 +25,7 @@ public class ClusterStatsRendererTests extends ESSingleNodeTestCase { ClusterStatsResponse clusterStats = client().admin().cluster().prepareClusterStats().get(); logger.debug("--> creating the cluster stats marvel document"); - ClusterStatsMarvelDoc marvelDoc = ClusterStatsMarvelDoc.createMarvelDoc("test", "marvel_cluster_stats", 1437580442979L, clusterStats); + ClusterStatsMarvelDoc marvelDoc = new ClusterStatsMarvelDoc("test", "marvel_cluster_stats", 1437580442979L, clusterStats); logger.debug("--> rendering the document"); Renderer renderer = new ClusterStatsRenderer(); diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java index e8208e72e80..90c4037c6ca 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexRecoveryRendererTests.java @@ -53,7 +53,7 @@ public class IndexRecoveryRendererTests extends ESTestCase { RecoveryResponse recoveryResponse = new RecoveryResponse(2, 2, 2, false, shardResponses, null); - IndexRecoveryMarvelDoc marvelDoc = IndexRecoveryMarvelDoc.createMarvelDoc("test", "marvel_index_recovery", 1437580442979L, recoveryResponse); + IndexRecoveryMarvelDoc marvelDoc = new IndexRecoveryMarvelDoc("test", "marvel_index_recovery", 1437580442979L, recoveryResponse); logger.debug("--> rendering the document"); Renderer renderer = new IndexRecoveryRenderer(); diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java index 2de2dd55ab3..c44c2e95467 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/indices/IndexStatsRendererTests.java @@ -29,7 +29,7 @@ public class IndexStatsRendererTests extends ESTestCase { @Test public void testIndexStatsRenderer() throws Exception { logger.debug("--> creating the index stats marvel document"); - IndexStatsMarvelDoc marvelDoc = IndexStatsMarvelDoc.createMarvelDoc("test", "marvel_index_stats", 1437580442979L, + IndexStatsMarvelDoc marvelDoc = new IndexStatsMarvelDoc("test", "marvel_index_stats", 1437580442979L, new IndexStats("index-0", new ShardStats[0]) { @Override public CommonStats getTotal() { diff --git a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java index a469abe28b1..7e826dfbc22 100644 --- a/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java +++ b/marvel/src/test/java/org/elasticsearch/marvel/agent/renderer/node/NodeStatsRendererTests.java @@ -27,7 +27,7 @@ public class NodeStatsRendererTests extends ESSingleNodeTestCase { NodeStats nodeStats = getInstanceFromNode(NodeService.class).stats(); logger.debug("--> creating the node stats marvel document"); - NodeStatsMarvelDoc marvelDoc = NodeStatsMarvelDoc.createMarvelDoc("test", "marvel_node_stats", 1437580442979L, + NodeStatsMarvelDoc marvelDoc = new NodeStatsMarvelDoc("test", "marvel_node_stats", 1437580442979L, "node-0", true, nodeStats, false, 90.0, true); logger.debug("--> rendering the document");