Skip to content

Commit 22005a1

Browse files
authored
[Backport master] Add architecture stats to cluster node stats (#5369)
* Add architecture stats to cluster node stats (#5338) (cherry picked from commit e635a2b) * Fix incorrect model for cluster stats (#5361) (cherry picked from commit 0617626)
1 parent 140ca8e commit 22005a1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

src/Nest/Cluster/ClusterStats/ClusterNodesStats.cs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@ public class ClusterOperatingSystemStats
177177

178178
[DataMember(Name = "pretty_names")]
179179
public IReadOnlyCollection<ClusterOperatingSystemPrettyNane> PrettyNames { get; internal set; }
180+
181+
[DataMember(Name = "architectures")]
182+
public IReadOnlyCollection<ArchitectureStats> Architectures { get; internal set; }
180183
}
181184

182185
[DataContract]
@@ -255,4 +258,14 @@ public class ClusterProcessorStats
255258
[DataMember(Name ="time_in_millis")]
256259
public long TimeInMilliseconds { get; set; }
257260
}
261+
262+
[DataContract]
263+
public class ArchitectureStats
264+
{
265+
[DataMember(Name = "arch")]
266+
public string Architecture { get; set; }
267+
268+
[DataMember(Name = "count")]
269+
public int Count { get; set; }
270+
}
258271
}

tests/Tests/Cluster/ClusterStats/ClusterStatsApiTests.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,14 @@ protected void Assert(ClusterNodesStats nodes)
7373
nodes.OperatingSystem.AvailableProcessors.Should().BeGreaterThan(0);
7474
nodes.OperatingSystem.AllocatedProcessors.Should().BeGreaterThan(0);
7575

76+
if (Cluster.ClusterConfiguration.Version.InRange(">=7.12.0"))
77+
{
78+
nodes.OperatingSystem.Architectures.Should().NotBeNull();
79+
nodes.OperatingSystem.Architectures.Count.Should().BeGreaterThan(0);
80+
nodes.OperatingSystem.Architectures.First().Architecture.Should().NotBeNullOrEmpty();
81+
nodes.OperatingSystem.Architectures.First().Count.Should().BeGreaterThan(0);
82+
}
83+
7684
nodes.OperatingSystem.Names.Should().NotBeEmpty();
7785

7886
if (Cluster.ClusterConfiguration.Version >= "6.8.0")

0 commit comments

Comments
 (0)