Skip to content

Add reserved, reserved_in_bytes to node stats response #4918

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions src/Nest/CommonOptions/Stats/StoreStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,35 @@ namespace Nest
[DataContract]
public class StoreStats
{
[DataMember(Name ="size")]
/// <summary>
/// Total size of all shards assigned to the node.
/// </summary>
[DataMember(Name = "size")]
public string Size { get; set; }

[DataMember(Name ="size_in_bytes")]
/// <summary>
/// Total size, in bytes, of all shards assigned to the node.
/// </summary>
// TODO: should be long
[DataMember(Name = "size_in_bytes")]
public double SizeInBytes { get; set; }

/// <summary>
/// A prediction of how much larger the shard stores on this node will eventually grow due to ongoing peer recoveries, restoring snapshots,
/// and similar activities. A value of -1b indicates that this is not available.
/// <para />
/// Valid in Elasticsearch 7.9.0+
/// </summary>
[DataMember(Name = "reserved")]
public string Reserved { get; set; }

/// <summary>
/// A prediction, in bytes, of how much larger the shard stores on this node will eventually grow due to ongoing peer recoveries,
/// restoring snapshots, and similar activities. A value of -1 indicates that this is not available.
/// <para />
/// Valid in Elasticsearch 7.9.0+
/// </summary>
[DataMember(Name = "reserved_in_bytes")]
public long ReservedInBytes { get; set; }
}
}
5 changes: 4 additions & 1 deletion tests/Tests/Cluster/NodesStats/NodesStatsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,10 @@ protected void Assert(IndexStats index)
//index.Documents.Count.Should().BeGreaterThan(0);

index.Store.Should().NotBeNull();
//index.Store.SizeInBytes.Should().BeGreaterThan(0);
index.Store.SizeInBytes.Should().BeGreaterOrEqualTo(0);

if (TestClient.Configuration.InRange(">=7.9.0"))
index.Store.ReservedInBytes.Should().BeGreaterOrEqualTo(0);

index.Completion.Should().NotBeNull();
index.Fielddata.Should().NotBeNull();
Expand Down