Skip to content

Commit 3f08a45

Browse files
authored
Add reserved, reserved_in_bytes to node stats response (#4918)
Relates: elastic/elasticsearch#58029
1 parent aed0a49 commit 3f08a45

File tree

2 files changed

+31
-3
lines changed

2 files changed

+31
-3
lines changed

src/Nest/CommonOptions/Stats/StoreStats.cs

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,35 @@ namespace Nest
99
[DataContract]
1010
public class StoreStats
1111
{
12-
[DataMember(Name ="size")]
12+
/// <summary>
13+
/// Total size of all shards assigned to the node.
14+
/// </summary>
15+
[DataMember(Name = "size")]
1316
public string Size { get; set; }
1417

15-
[DataMember(Name ="size_in_bytes")]
18+
/// <summary>
19+
/// Total size, in bytes, of all shards assigned to the node.
20+
/// </summary>
21+
// TODO: should be long
22+
[DataMember(Name = "size_in_bytes")]
1623
public double SizeInBytes { get; set; }
24+
25+
/// <summary>
26+
/// A prediction of how much larger the shard stores on this node will eventually grow due to ongoing peer recoveries, restoring snapshots,
27+
/// and similar activities. A value of -1b indicates that this is not available.
28+
/// <para />
29+
/// Valid in Elasticsearch 7.9.0+
30+
/// </summary>
31+
[DataMember(Name = "reserved")]
32+
public string Reserved { get; set; }
33+
34+
/// <summary>
35+
/// A prediction, in bytes, of how much larger the shard stores on this node will eventually grow due to ongoing peer recoveries,
36+
/// restoring snapshots, and similar activities. A value of -1 indicates that this is not available.
37+
/// <para />
38+
/// Valid in Elasticsearch 7.9.0+
39+
/// </summary>
40+
[DataMember(Name = "reserved_in_bytes")]
41+
public long ReservedInBytes { get; set; }
1742
}
1843
}

tests/Tests/Cluster/NodesStats/NodesStatsApiTests.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,10 @@ protected void Assert(IndexStats index)
122122
//index.Documents.Count.Should().BeGreaterThan(0);
123123

124124
index.Store.Should().NotBeNull();
125-
//index.Store.SizeInBytes.Should().BeGreaterThan(0);
125+
index.Store.SizeInBytes.Should().BeGreaterOrEqualTo(0);
126+
127+
if (TestClient.Configuration.InRange(">=7.9.0"))
128+
index.Store.ReservedInBytes.Should().BeGreaterOrEqualTo(0);
126129

127130
index.Completion.Should().NotBeNull();
128131
index.Fielddata.Should().NotBeNull();

0 commit comments

Comments
 (0)