Skip to content

Commit

Permalink
[Backport 7.6] Add ingest info to Cluster Stats response (#4415)
Browse files Browse the repository at this point in the history
Relates: #4341, elastic/elasticsearch#48485

Co-authored-by: Russ Cam <russ.cam@elastic.co>
  • Loading branch information
github-actions[bot] and russcam authored Feb 21, 2020
1 parent 54ca29e commit 22ef4a0
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
30 changes: 30 additions & 0 deletions src/Nest/Cluster/ClusterStats/ClusterNodesStats.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System.Collections.Generic;
using System.Runtime.Serialization;
using Elasticsearch.Net;

namespace Nest
{
Expand Down Expand Up @@ -35,6 +36,9 @@ public class ClusterNodesStats

[DataMember(Name = "versions")]
public IReadOnlyCollection<string> Versions { get; internal set; }

[DataMember(Name = "ingest")]
public ClusterIngestStats Ingest { get; internal set; }
}

public class NodePackagingType
Expand Down Expand Up @@ -222,4 +226,30 @@ public class ClusterNodeCount
[DataMember(Name = "voting_only")]
public int VotingOnly { get; internal set; }
}

[DataContract]
public class ClusterIngestStats
{
[DataMember(Name = "number_of_pipelines")]
public int NumberOfPipelines { get; internal set; }

[DataMember(Name = "processor_stats")]
public IReadOnlyDictionary<string, ClusterProcessorStats> ProcessorStats { get; internal set; }
}

[DataContract]
public class ClusterProcessorStats
{
[DataMember(Name ="count")]
public long Count { get; set; }

[DataMember(Name ="current")]
public long Current { get; set; }

[DataMember(Name ="failed")]
public long Failed { get; set; }

[DataMember(Name ="time_in_millis")]
public long TimeInMilliseconds { get; set; }
}
}
3 changes: 3 additions & 0 deletions tests/Tests/Cluster/ClusterStats/ClusterStatsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ protected void Assert(ClusterNodesStats nodes)
nodes.Process.OpenFileDescriptors.Min.Should().NotBe(0);

nodes.Versions.Should().NotBeEmpty();

if (Cluster.ClusterConfiguration.Version >= "7.6.0")
nodes.Ingest.Should().NotBeNull();
}

protected void Assert(ClusterIndicesStats indices)
Expand Down

0 comments on commit 22ef4a0

Please sign in to comment.