Skip to content

Fix incorrect model for cluster stats #5361

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
Feb 26, 2021
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
6 changes: 3 additions & 3 deletions src/Nest/Cluster/ClusterStats/ClusterNodesStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ public class ClusterNodesStats

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

[DataMember(Name = "architectures")]
public IReadOnlyCollection<ArchitectureStats> Architectures { get; internal set; }
}

public class NodePackagingType
Expand Down Expand Up @@ -180,6 +177,9 @@ public class ClusterOperatingSystemStats

[DataMember(Name = "pretty_names")]
public IReadOnlyCollection<ClusterOperatingSystemPrettyNane> PrettyNames { get; internal set; }

[DataMember(Name = "architectures")]
public IReadOnlyCollection<ArchitectureStats> Architectures { get; internal set; }
}

[DataContract]
Expand Down
16 changes: 8 additions & 8 deletions tests/Tests/Cluster/ClusterStats/ClusterStatsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ protected void Assert(ClusterNodesStats nodes)
nodes.OperatingSystem.AvailableProcessors.Should().BeGreaterThan(0);
nodes.OperatingSystem.AllocatedProcessors.Should().BeGreaterThan(0);

if (Cluster.ClusterConfiguration.Version.InRange(">=7.12.0"))
{
nodes.OperatingSystem.Architectures.Should().NotBeNull();
nodes.OperatingSystem.Architectures.Count.Should().BeGreaterThan(0);
nodes.OperatingSystem.Architectures.First().Architecture.Should().NotBeNullOrEmpty();
nodes.OperatingSystem.Architectures.First().Count.Should().BeGreaterThan(0);
}

nodes.OperatingSystem.Names.Should().NotBeEmpty();

if (Cluster.ClusterConfiguration.Version >= "6.8.0")
Expand Down Expand Up @@ -100,14 +108,6 @@ protected void Assert(ClusterNodesStats nodes)

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

if (Cluster.ClusterConfiguration.Version >= "7.12.0")
{
nodes.Architectures.Should().NotBeNull();
nodes.Architectures.Count.Should().BeGreaterThan(0);
nodes.Architectures.First().Architecture.Should().NotBeNullOrEmpty();
nodes.Architectures.First().Count.Should().BeGreaterThan(0);
}
}

protected void Assert(ClusterIndicesStats indices)
Expand Down