From 33bb2ecfa8c144c529ac356f31b8c7562abb3370 Mon Sep 17 00:00:00 2001 From: Boaz Leskes Date: Tue, 17 Dec 2013 16:04:55 +0100 Subject: [PATCH] Added a time stamp to the cluster stats response Making it consistent with NodeStats --- .../admin/cluster/stats/ClusterStatsResponse.java | 12 ++++++++++-- .../cluster/stats/TransportClusterStatsAction.java | 3 ++- .../admin/cluster/stats/ClusterStatsTests.java | 1 + 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java b/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java index 53399f2f3b5..be74ffc48ec 100644 --- a/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java +++ b/src/main/java/org/elasticsearch/action/admin/cluster/stats/ClusterStatsResponse.java @@ -37,22 +37,27 @@ import java.util.Map; */ public class ClusterStatsResponse extends NodesOperationResponse implements ToXContent { - ClusterStatsNodes nodesStats; ClusterStatsIndices indicesStats; String clusterUUID; + long timestamp; ClusterStatsResponse() { } - public ClusterStatsResponse(ClusterName clusterName, String clusterUUID, ClusterStatsNodeResponse[] nodes) { + public ClusterStatsResponse(long timestamp, ClusterName clusterName, String clusterUUID, ClusterStatsNodeResponse[] nodes) { super(clusterName, null); + this.timestamp = timestamp; this.clusterUUID = clusterUUID; nodesStats = new ClusterStatsNodes(nodes); indicesStats = new ClusterStatsIndices(nodes); } + public long getTimestamp() { + return this.timestamp; + } + public ClusterStatsNodes getNodesStats() { return nodesStats; } @@ -84,6 +89,7 @@ public class ClusterStatsResponse extends NodesOperationResponse