Skip to content

Commit eee8bf8

Browse files
russcamMpdreamz
authored andcommitted
Align thread pool info to thread pool configuration (#3847)
Relates: elastic/elasticsearch#29123
1 parent 42803e0 commit eee8bf8

File tree

3 files changed

+31
-6
lines changed

3 files changed

+31
-6
lines changed

src/Nest/Cat/CatThreadPool/CatThreadPoolRecord.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ public class CatThreadPoolRecord : ICatRecord
1010
/// The number of active threads in the current thread pool
1111
/// </summary>
1212
[DataMember(Name = "active")]
13-
[JsonFormatter(typeof(StringLongFormatter))]
14-
public long Active { get; set; }
13+
[JsonFormatter(typeof(StringIntFormatter))]
14+
public int Active { get; set; }
1515

1616
/// <summary>
1717
/// The number of tasks completed by the thread pool executor
@@ -108,8 +108,8 @@ public class CatThreadPoolRecord : ICatRecord
108108
/// The number of tasks in the queue for the current thread pool
109109
/// </summary>
110110
[DataMember(Name = "queue")]
111-
[JsonFormatter(typeof(StringLongFormatter))]
112-
public long Queue { get; set; }
111+
[JsonFormatter(typeof(StringIntFormatter))]
112+
public int Queue { get; set; }
113113

114114
/// <summary>
115115
/// The maximum number of tasks permitted in the queue for the current thread pool

src/Nest/Cluster/NodesInfo/NodeInfo.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,18 +222,39 @@ public class NodeInfoJvmMemory
222222
[DataContract]
223223
public class NodeThreadPoolInfo
224224
{
225+
/// <summary>
226+
/// The configured keep alive time for threads
227+
/// </summary>
225228
[DataMember(Name = "keep_alive")]
226229
public string KeepAlive { get; internal set; }
227230

231+
/// <summary>
232+
/// The configured maximum number of active threads allowed in the current thread pool
233+
/// </summary>
228234
[DataMember(Name = "max")]
229235
public int? Max { get; internal set; }
230236

231-
[DataMember(Name = "min")]
232-
public int? Min { get; internal set; }
237+
/// <summary>
238+
/// The configured core number of active threads allowed in the current thread pool
239+
/// </summary>
240+
[DataMember(Name = "core")]
241+
public int? Core { get; internal set; }
233242

243+
/// <summary>
244+
/// The configured fixed number of active threads allowed in the current thread pool
245+
/// </summary>
246+
[DataMember(Name = "size")]
247+
public int? Size { get; internal set; }
248+
249+
/// <summary>
250+
/// The maximum number of tasks permitted in the queue for the current thread pool
251+
/// </summary>
234252
[DataMember(Name = "queue_size")]
235253
public int? QueueSize { get; internal set; }
236254

255+
/// <summary>
256+
/// The type of thread pool
257+
/// </summary>
237258
[DataMember(Name = "type")]
238259
public string Type { get; internal set; }
239260
}

src/Tests/Tests/Cluster/NodesInfo/NodesInfoApiTests.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,10 @@ protected void Assert(IReadOnlyDictionary<string, NodeThreadPoolInfo> pools)
118118
pool.KeepAlive.Should().NotBeNullOrWhiteSpace();
119119
pool.Type.Should().Be("scaling");
120120
pool.QueueSize.Should().BeGreaterOrEqualTo(-1);
121+
122+
// both should have a value for a scaling pool
123+
pool.Core.Should().HaveValue();
124+
pool.Max.Should().HaveValue();
121125
}
122126

123127
protected void Assert(NodeInfoTransport transport)

0 commit comments

Comments
 (0)