Skip to content

Align Cat Threadpool properties #3844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 20, 2019
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
118 changes: 90 additions & 28 deletions src/Nest/Cat/CatThreadPool/CatThreadPoolRecord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,74 +6,136 @@ namespace Nest
[DataContract]
public class CatThreadPoolRecord : ICatRecord
{
[DataMember(Name ="active")]
[JsonFormatter(typeof(StringIntFormatter))]
public int Active { get; set; }
/// <summary>
/// The number of active threads in the current thread pool
/// </summary>
[DataMember(Name = "active")]
[JsonFormatter(typeof(StringLongFormatter))]
public long Active { get; set; }

[DataMember(Name ="completed")]
/// <summary>
/// The number of tasks completed by the thread pool executor
/// </summary>
[DataMember(Name = "completed")]
[JsonFormatter(typeof(NullableStringLongFormatter))]
public long? Completed { get; set; }

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

/// <summary>
/// The ephemeral node ID
/// </summary>
[DataMember(Name = "ephemeral_node_id")]
public string EphemeralNodeId { get; set; }

[DataMember(Name ="host")]
/// <summary>
/// The hostname for the current node
/// </summary>
[DataMember(Name = "host")]
public string Host { get; set; }

[DataMember(Name ="ip")]
/// <summary>
/// The IP address for the current node
/// </summary>
[DataMember(Name = "ip")]
public string Ip { get; set; }

[DataMember(Name ="keep_alive")]
/// <summary>
/// The configured keep alive time for threads
/// </summary>
[DataMember(Name = "keep_alive")]
public Time KeepAlive { get; set; }

[DataMember(Name ="largest")]
/// <summary>
/// The highest number of active threads in the current thread pool
/// </summary>
[DataMember(Name = "largest")]
[JsonFormatter(typeof(NullableStringIntFormatter))]
public int? Largest { get; set; }

//TODO: This is now often reported back as null since 7.x (investigate)
[DataMember(Name ="max")]
/// <summary>
/// The configured maximum number of active threads allowed in the current thread pool
/// </summary>
[DataMember(Name = "max")]
[JsonFormatter(typeof(NullableStringIntFormatter))]
public int? Maximum { get; set; }

//TODO: this appears to no longer be reported
[DataMember(Name ="min")]
[JsonFormatter(typeof(NullableStringIntFormatter))]
public int? Minimum { get; set; }

[DataMember(Name ="name")]
/// <summary>
/// The name of the thread pool
/// </summary>
[DataMember(Name = "name")]
public string Name { get; set; }

[DataMember(Name ="node_id")]
/// <summary>
/// The unique id of the node
/// </summary>
[DataMember(Name = "node_id")]
public string NodeId { get; set; }

[DataMember(Name ="node_name")]
/// <summary>
/// The name of the node
/// </summary>
[DataMember(Name = "node_name")]
public string NodeName { get; set; }

[DataMember(Name ="port")]
/// <summary>
/// The number of threads in the current thread pool
/// </summary>
[DataMember(Name = "pool_size")]
[JsonFormatter(typeof(NullableStringIntFormatter))]
public int? PoolSize { get; set; }

/// <summary>
/// The bound transport port for the current node
/// </summary>
[DataMember(Name = "port")]
[JsonFormatter(typeof(NullableStringIntFormatter))]
public int? Port { get; set; }

[DataMember(Name ="pid")]
/// <summary>
/// The process ID of the running node
/// </summary>
[DataMember(Name = "pid")]
[JsonFormatter(typeof(NullableStringIntFormatter))]
public int? ProcessId { get; set; }

[DataMember(Name ="queue")]
[JsonFormatter(typeof(StringIntFormatter))]
public int Queue { get; set; }
/// <summary>
/// The number of tasks in the queue for the current thread pool
/// </summary>
[DataMember(Name = "queue")]
[JsonFormatter(typeof(StringLongFormatter))]
public long Queue { get; set; }

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

[DataMember(Name ="rejected")]
/// <summary>
/// The number of tasks rejected by the thread pool executor
/// </summary>
[DataMember(Name = "rejected")]
[JsonFormatter(typeof(StringLongFormatter))]
public long Rejected { get; set; }

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

[DataMember(Name ="type")]
/// <summary>
/// The current (*) type of thread pool (`fixed` or `scaling`)
/// </summary>
[DataMember(Name = "type")]
public string Type { get; set; }
}
}
1 change: 0 additions & 1 deletion src/Tests/Tests/Cat/CatThreadPool/CatThreadpoolApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ protected override void ExpectResponse(CatResponse<CatThreadPoolRecord> response
{
response.Records.Should().NotBeNull();


foreach (var r in response.Records)
{
r.EphemeralNodeId.Should().NotBeNullOrWhiteSpace();
Expand Down