Skip to content
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
8 changes: 4 additions & 4 deletions src/Nest/Cat/CatThreadPool/CatThreadPoolRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ public class CatThreadPoolRecord : ICatRecord
/// The number of active threads in the current thread pool
/// </summary>
[DataMember(Name = "active")]
[JsonFormatter(typeof(StringLongFormatter))]
public long Active { get; set; }
[JsonFormatter(typeof(StringIntFormatter))]
public int Active { get; set; }

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

/// <summary>
/// The maximum number of tasks permitted in the queue for the current thread pool
Expand Down
25 changes: 23 additions & 2 deletions src/Nest/Cluster/NodesInfo/NodeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,39 @@ public class NodeInfoJvmMemory
[DataContract]
public class NodeThreadPoolInfo
{
/// <summary>
/// The configured keep alive time for threads
/// </summary>
[DataMember(Name = "keep_alive")]
public string KeepAlive { get; internal set; }

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

[DataMember(Name = "min")]
public int? Min { get; internal set; }
/// <summary>
/// The configured core number of active threads allowed in the current thread pool
/// </summary>
[DataMember(Name = "core")]
public int? Core { get; internal set; }

/// <summary>
/// The configured fixed number of active threads allowed in the current thread pool
/// </summary>
[DataMember(Name = "size")]
public int? Size { get; internal set; }

/// <summary>
/// The maximum number of tasks permitted in the queue for the current thread pool
/// </summary>
[DataMember(Name = "queue_size")]
public int? QueueSize { get; internal set; }

/// <summary>
/// The type of thread pool
/// </summary>
[DataMember(Name = "type")]
public string Type { get; internal set; }
}
Expand Down
4 changes: 4 additions & 0 deletions src/Tests/Tests/Cluster/NodesInfo/NodesInfoApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ protected void Assert(IReadOnlyDictionary<string, NodeThreadPoolInfo> pools)
pool.KeepAlive.Should().NotBeNullOrWhiteSpace();
pool.Type.Should().Be("scaling");
pool.QueueSize.Should().BeGreaterOrEqualTo(-1);

// both should have a value for a scaling pool
pool.Core.Should().HaveValue();
pool.Max.Should().HaveValue();
}

protected void Assert(NodeInfoTransport transport)
Expand Down