Skip to content

Commit 79fd31d

Browse files
russcamSpencerLN
andcommitted
Fix 3698: Update ClusterHealthResponse.cs to align with ClusterHealthResponse.java (#3699)
Updated ClusterHealthResponse.cs to align with ClusterHealthResponse.java. Previously missing fields included "ActiveShardsPerecentAsNumber", "DelayedUnassignedShards", "NumberOfInFlightFetch", and "TaskMaxWaitTimeInQueueInMilliseconds". Co-Authored-By: SpencerLN <spencer@spencerniemi.com> (cherry picked from commit 0550076)
1 parent 0e37dce commit 79fd31d

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

src/Nest/Cluster/ClusterHealth/ClusterHealthResponse.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@ public class ClusterHealthResponse : ResponseBase
1313
[DataMember(Name = "active_shards")]
1414
public int ActiveShards { get; internal set; }
1515

16+
[DataMember(Name = "active_shards_percent_as_number")]
17+
public double ActiveShardsPercentAsNumber { get; internal set; }
18+
1619
[DataMember(Name = "cluster_name")]
1720
public string ClusterName { get; internal set; }
1821

22+
[DataMember(Name = "delayed_unassigned_shards")]
23+
public int DelayedUnassignedShards { get; internal set; }
24+
1925
[DataMember(Name = "indices")]
2026
[JsonFormatter(typeof(ResolvableReadOnlyDictionaryFormatter<IndexName, IndexHealthStats>))]
2127
public IReadOnlyDictionary<IndexName, IndexHealthStats> Indices { get; internal set; } =
@@ -27,6 +33,9 @@ public class ClusterHealthResponse : ResponseBase
2733
[DataMember(Name = "number_of_data_nodes")]
2834
public int NumberOfDataNodes { get; internal set; }
2935

36+
[DataMember(Name = "number_of_in_flight_fetch")]
37+
public int NumberOfInFlightFetch { get; internal set; }
38+
3039
[DataMember(Name = "number_of_nodes")]
3140
public int NumberOfNodes { get; internal set; }
3241

@@ -39,6 +48,9 @@ public class ClusterHealthResponse : ResponseBase
3948
[DataMember(Name = "status")]
4049
public Health Status { get; internal set; }
4150

51+
[DataMember(Name = "task_max_waiting_in_queue_millis")]
52+
public long TaskMaxWaitTimeInQueueInMilliseconds { get; internal set; }
53+
4254
[DataMember(Name = "timed_out")]
4355
public bool TimedOut { get; internal set; }
4456

src/Tests/Tests/Cluster/ClusterHealth/ClusterHealthApiTests.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ protected override void ExpectResponse(ClusterHealthResponse response)
6969
response.NumberOfDataNodes.Should().BeGreaterOrEqualTo(1);
7070
response.ActivePrimaryShards.Should().BeGreaterOrEqualTo(1);
7171
response.ActiveShards.Should().BeGreaterOrEqualTo(1);
72+
response.ActiveShardsPercentAsNumber.Should().BePositive();
73+
response.DelayedUnassignedShards.Should().Equals(0);
74+
response.NumberOfInFlightFetch.Should().BeGreaterOrEqualTo(0);
75+
response.TaskMaxWaitTimeInQueueInMilliseconds.Should().BeGreaterOrEqualTo(0);
76+
7277
response.Indices.Should()
7378
.NotBeEmpty()
7479
.And.ContainKey(Index<Developer>());

0 commit comments

Comments
 (0)