Skip to content

Commit 388a3b0

Browse files
Add architecture stats to cluster node stats (#5338) (#5349)
Co-authored-by: Steve Gordon <sgordon@hotmail.co.uk>
1 parent d88ece1 commit 388a3b0

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
@@ -42,6 +42,9 @@ public class ClusterNodesStats
4242

4343
[DataMember(Name = "ingest")]
4444
public ClusterIngestStats Ingest { get; internal set; }
45+
46+
[DataMember(Name = "architectures")]
47+
public IReadOnlyCollection<ArchitectureStats> Architectures { get; internal set; }
4548
}
4649

4750
public class NodePackagingType
@@ -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
@@ -100,6 +100,14 @@ protected void Assert(ClusterNodesStats nodes)
100100

101101
if (Cluster.ClusterConfiguration.Version >= "7.6.0")
102102
nodes.Ingest.Should().NotBeNull();
103+
104+
if (Cluster.ClusterConfiguration.Version >= "7.12.0")
105+
{
106+
nodes.Architectures.Should().NotBeNull();
107+
nodes.Architectures.Count.Should().BeGreaterThan(0);
108+
nodes.Architectures.First().Architecture.Should().NotBeNullOrEmpty();
109+
nodes.Architectures.First().Count.Should().BeGreaterThan(0);
110+
}
103111
}
104112

105113
protected void Assert(ClusterIndicesStats indices)

0 commit comments

Comments
 (0)