From f1bb8afe84e3eec0adf7486fae2c62f0837f2ab6 Mon Sep 17 00:00:00 2001 From: Stuart Cam Date: Wed, 8 May 2019 14:31:30 +1000 Subject: [PATCH] Add time since last auto follow fetch to auto follow stats (#3727) Add time since last auto follow fetch to auto follow stats (#3727) --- .../Stats/CcrStatsResponse.cs | 44 +++++++++++++++---- 1 file changed, 35 insertions(+), 9 deletions(-) diff --git a/src/Nest/XPack/CrossClusterReplication/Stats/CcrStatsResponse.cs b/src/Nest/XPack/CrossClusterReplication/Stats/CcrStatsResponse.cs index 6f012eafca7..119268780e8 100644 --- a/src/Nest/XPack/CrossClusterReplication/Stats/CcrStatsResponse.cs +++ b/src/Nest/XPack/CrossClusterReplication/Stats/CcrStatsResponse.cs @@ -1,4 +1,5 @@ -using System.Collections.Generic; +using System; +using System.Collections.Generic; using Elasticsearch.Net; using Newtonsoft.Json; @@ -22,7 +23,6 @@ public class CcrStatsResponse : ResponseBase, ICcrStatsResponse public CcrFollowStats FollowStats { get; internal set; } } - public class CcrFollowStats { /// @@ -32,28 +32,54 @@ public class CcrFollowStats public class CcrAutoFollowStats { - /// - /// the number of indices that the auto-follow coordinator failed to automatically follow; the causes of recent failures are - /// captured in the logs of the elected master node, and in the auto_follow_stats.recent_auto_follow_errors field + /// The number of indices that the auto-follow coordinator failed to automatically follow; the causes of recent failures are + /// captured in the logs of the elected master node, and in the field. /// [JsonProperty("number_of_failed_follow_indices")] public long NumberOfFailedFollowIndices { get; internal set; } /// - /// the number of times that the auto-follow coordinator failed to retrieve the cluster state from a - /// remote cluster registered in a collection of auto-follow patterns + /// The number of times that the auto-follow coordinator failed to retrieve the cluster state from a + /// remote cluster registered in a collection of auto-follow patterns. /// [JsonProperty("number_of_failed_remote_cluster_state_requests")] public long NumberOfFailedRemoteClusterStateRequests { get; internal set; } - /// the number of indices that the auto-follow coordinator successfully followed + /// The number of indices that the auto-follow coordinator successfully followed. [JsonProperty("number_of_successful_follow_indices")] public long NumberOfSuccessfulFollowIndices { get; internal set; } - /// an array of objects representing failures by the auto-follow coordinator + /// An array of objects representing failures by the auto-follow coordinator. [JsonProperty("recent_auto_follow_errors")] public IReadOnlyCollection RecentAutoFollowErrors { get; internal set; } = EmptyReadOnly.Collection; + /// + /// An array of auto followed clusters. + /// + [JsonProperty("auto_followed_clusters")] + public IReadOnlyCollection< AutoFollowedCluster> AutoFollowedClusters { get; internal set; } = EmptyReadOnly.Collection; + } + + public class AutoFollowedCluster + { + /// + /// The cluster name. + /// + [JsonProperty("cluster_name")] + public string ClusterName { get; internal set; } + + /// + /// Time since last check. + /// + [JsonProperty("time_since_last_check_millis")] + [JsonConverter(typeof(EpochMillisecondsDateTimeJsonConverter))] + public DateTimeOffset TimeSinceLastCheck { get; internal set; } + + /// + /// Last seen metadata version. + /// + [JsonProperty("last_seen_metadata_version")] + public long LastSeenMetadataVersion { get; internal set; } } }