Skip to content

Commit 58bca4d

Browse files
authored
Add ingest info to Cluster Stats response (#4407)
Relates: #4341, elastic/elasticsearch#48485
1 parent 40889d1 commit 58bca4d

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/Nest/Cluster/ClusterStats/ClusterNodesStats.cs

+30
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System.Collections.Generic;
22
using System.Runtime.Serialization;
3+
using Elasticsearch.Net;
34

45
namespace Nest
56
{
@@ -35,6 +36,9 @@ public class ClusterNodesStats
3536

3637
[DataMember(Name = "versions")]
3738
public IReadOnlyCollection<string> Versions { get; internal set; }
39+
40+
[DataMember(Name = "ingest")]
41+
public ClusterIngestStats Ingest { get; internal set; }
3842
}
3943

4044
public class NodePackagingType
@@ -222,4 +226,30 @@ public class ClusterNodeCount
222226
[DataMember(Name = "voting_only")]
223227
public int VotingOnly { get; internal set; }
224228
}
229+
230+
[DataContract]
231+
public class ClusterIngestStats
232+
{
233+
[DataMember(Name = "number_of_pipelines")]
234+
public int NumberOfPipelines { get; internal set; }
235+
236+
[DataMember(Name = "processor_stats")]
237+
public IReadOnlyDictionary<string, ClusterProcessorStats> ProcessorStats { get; internal set; }
238+
}
239+
240+
[DataContract]
241+
public class ClusterProcessorStats
242+
{
243+
[DataMember(Name ="count")]
244+
public long Count { get; set; }
245+
246+
[DataMember(Name ="current")]
247+
public long Current { get; set; }
248+
249+
[DataMember(Name ="failed")]
250+
public long Failed { get; set; }
251+
252+
[DataMember(Name ="time_in_millis")]
253+
public long TimeInMilliseconds { get; set; }
254+
}
225255
}

tests/Tests/Cluster/ClusterStats/ClusterStatsApiTests.cs

+3
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,9 @@ protected void Assert(ClusterNodesStats nodes)
9393
nodes.Process.OpenFileDescriptors.Min.Should().NotBe(0);
9494

9595
nodes.Versions.Should().NotBeEmpty();
96+
97+
if (Cluster.ClusterConfiguration.Version >= "7.6.0")
98+
nodes.Ingest.Should().NotBeNull();
9699
}
97100

98101
protected void Assert(ClusterIndicesStats indices)

0 commit comments

Comments
 (0)