Skip to content

Commit e3763bb

Browse files
committed
Merge pull request #1390 from elastic/feature/cat-nodes-file-descs
fix #1350 added new columns in the cat nodes API
2 parents 4f68104 + ea9abbe commit e3763bb

File tree

2 files changed

+52
-0
lines changed

2 files changed

+52
-0
lines changed

src/Nest/Domain/Cat/CatNodesRecord.cs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,14 @@ public class CatNodesRecord : ICatRecord
6363
internal string _diskAvail { get; set; }
6464
public string DiskAvailable { get { return this._diskAvail ?? this._disk ?? this._d ?? this._disk_avail; }}
6565

66+
[JsonProperty("heap.current")]
67+
internal string _heap_current { get; set; }
68+
[JsonProperty("hc")]
69+
internal string _hc { get; set; }
70+
[JsonProperty("heapCurrent")]
71+
internal string _heapCurrent { get; set; }
72+
public string HeapCurrent { get { return this._heapCurrent ?? this._hc ?? this._heap_current; }}
73+
6674
[JsonProperty("heap.percent")]
6775
internal string _heap_percent { get; set; }
6876
[JsonProperty("hp")]
@@ -79,6 +87,14 @@ public class CatNodesRecord : ICatRecord
7987
internal string _heapMax { get; set; }
8088
public string HeapMax { get { return this._heapMax ?? this._hm ?? this._heap_max; }}
8189

90+
[JsonProperty("ram.current")]
91+
internal string _ram_current { get; set; }
92+
[JsonProperty("rc")]
93+
internal string _rc { get; set; }
94+
[JsonProperty("ramCurrent")]
95+
internal string _ramCurrent { get; set; }
96+
public string RamCurrent { get { return this._ramCurrent ?? this._rc ?? this._ram_current; }}
97+
8298
[JsonProperty("ram.percent")]
8399
internal string _ram_percent { get; set; }
84100
[JsonProperty("rp")]
@@ -187,6 +203,30 @@ public class CatNodesRecord : ICatRecord
187203
internal string _flushTotalTime { get; set; }
188204
public string FlushTotalTime { get { return this._flushTotalTime ?? this._ftt ?? this._flush_total_time; }}
189205

206+
[JsonProperty("file_desc.current")]
207+
internal int? _file_desc_current { get; set; }
208+
[JsonProperty("fdc")]
209+
internal int? _fdc { get; set; }
210+
[JsonProperty("fileDescriptorCurrent")]
211+
internal int? _fileDescriptorCurrent { get; set; }
212+
public int? FileDescriptorCurrent { get { return this._fileDescriptorCurrent ?? this._fdc ?? this._file_desc_current; }}
213+
214+
[JsonProperty("file_desc.percent")]
215+
internal int? _file_desc_percent { get; set; }
216+
[JsonProperty("fdp")]
217+
internal int? _fdp { get; set; }
218+
[JsonProperty("fileDescriptorPercent")]
219+
internal int? _fileDescriptorPercent { get; set; }
220+
public int? FileDescriptorPercent { get { return this._fileDescriptorPercent ?? this._fdp ?? this._file_desc_percent; }}
221+
222+
[JsonProperty("file_desc.max")]
223+
internal int? _file_desc_max { get; set; }
224+
[JsonProperty("fdm")]
225+
internal int? _fdm { get; set; }
226+
[JsonProperty("fileDescriptorMax")]
227+
internal int? _fileDescriptorMax { get; set; }
228+
public int? FileDescriptorMax { get { return this._fileDescriptorMax ?? this._fdm ?? this._file_desc_max; }}
229+
190230
[JsonProperty("get.current")]
191231
internal string _get_current { get; set; }
192232
[JsonProperty("gc")]

src/Tests/Nest.Tests.Integration/Core/Cat/CatTests.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,18 @@ public void CatNodes()
138138
TestCat(() => this._client.CatNodes(v => v.H("b")), r => !r.Build.IsNullOrEmpty());
139139
}
140140

141+
[Test]
142+
public void CatNodesFileDescriptors()
143+
{
144+
TestCat(() => this._client.CatNodes(v => v.H("b", "fdc", "fdp", "fdm")), r =>
145+
!r.Build.IsNullOrEmpty()
146+
&& r.FileDescriptorCurrent.HasValue && r.FileDescriptorCurrent.Value > 0
147+
&& r.FileDescriptorPercent.HasValue
148+
&& r.FileDescriptorMax.HasValue
149+
150+
);
151+
}
152+
141153
[Test]
142154
public async void CatNodesAsync()
143155
{

0 commit comments

Comments
 (0)