Skip to content

Commit 5094542

Browse files
committed
Align Cat Threadpool properties
Relates: elastic/elasticsearch#29195
1 parent 8965d1c commit 5094542

File tree

2 files changed

+90
-29
lines changed

2 files changed

+90
-29
lines changed

src/Nest/Cat/CatThreadPool/CatThreadPoolRecord.cs

+90-28
Original file line numberDiff line numberDiff line change
@@ -6,74 +6,136 @@ namespace Nest
66
[DataContract]
77
public class CatThreadPoolRecord : ICatRecord
88
{
9-
[DataMember(Name ="active")]
10-
[JsonFormatter(typeof(StringIntFormatter))]
11-
public int Active { get; set; }
9+
/// <summary>
10+
/// The number of active threads in the current thread pool
11+
/// </summary>
12+
[DataMember(Name = "active")]
13+
[JsonFormatter(typeof(StringLongFormatter))]
14+
public long Active { get; set; }
1215

13-
[DataMember(Name ="completed")]
16+
/// <summary>
17+
/// The number of tasks completed by the thread pool executor
18+
/// </summary>
19+
[DataMember(Name = "completed")]
1420
[JsonFormatter(typeof(NullableStringLongFormatter))]
1521
public long? Completed { get; set; }
1622

17-
[DataMember(Name ="ephemeral_node_id")]
23+
/// <summary>
24+
/// The configured core number of active threads allowed in the current thread pool
25+
/// </summary>
26+
[DataMember(Name = "core")]
27+
[JsonFormatter(typeof(NullableStringIntFormatter))]
28+
public int? Core { get; set; }
29+
30+
/// <summary>
31+
/// The ephemeral node ID
32+
/// </summary>
33+
[DataMember(Name = "ephemeral_node_id")]
1834
public string EphemeralNodeId { get; set; }
1935

20-
[DataMember(Name ="host")]
36+
/// <summary>
37+
/// The hostname for the current node
38+
/// </summary>
39+
[DataMember(Name = "host")]
2140
public string Host { get; set; }
2241

23-
[DataMember(Name ="ip")]
42+
/// <summary>
43+
/// The IP address for the current node
44+
/// </summary>
45+
[DataMember(Name = "ip")]
2446
public string Ip { get; set; }
2547

26-
[DataMember(Name ="keep_alive")]
48+
/// <summary>
49+
/// The configured keep alive time for threads
50+
/// </summary>
51+
[DataMember(Name = "keep_alive")]
2752
public Time KeepAlive { get; set; }
2853

29-
[DataMember(Name ="largest")]
54+
/// <summary>
55+
/// The highest number of active threads in the current thread pool
56+
/// </summary>
57+
[DataMember(Name = "largest")]
3058
[JsonFormatter(typeof(NullableStringIntFormatter))]
3159
public int? Largest { get; set; }
3260

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

38-
//TODO: this appears to no longer be reported
39-
[DataMember(Name ="min")]
40-
[JsonFormatter(typeof(NullableStringIntFormatter))]
41-
public int? Minimum { get; set; }
42-
43-
[DataMember(Name ="name")]
68+
/// <summary>
69+
/// The name of the thread pool
70+
/// </summary>
71+
[DataMember(Name = "name")]
4472
public string Name { get; set; }
4573

46-
[DataMember(Name ="node_id")]
74+
/// <summary>
75+
/// The unique id of the node
76+
/// </summary>
77+
[DataMember(Name = "node_id")]
4778
public string NodeId { get; set; }
4879

49-
[DataMember(Name ="node_name")]
80+
/// <summary>
81+
/// The name of the node
82+
/// </summary>
83+
[DataMember(Name = "node_name")]
5084
public string NodeName { get; set; }
5185

52-
[DataMember(Name ="port")]
86+
/// <summary>
87+
/// The number of threads in the current thread pool
88+
/// </summary>
89+
[DataMember(Name = "pool_size")]
90+
[JsonFormatter(typeof(NullableStringIntFormatter))]
91+
public int? PoolSize { get; set; }
92+
93+
/// <summary>
94+
/// The bound transport port for the current node
95+
/// </summary>
96+
[DataMember(Name = "port")]
5397
[JsonFormatter(typeof(NullableStringIntFormatter))]
5498
public int? Port { get; set; }
5599

56-
[DataMember(Name ="pid")]
100+
/// <summary>
101+
/// The process ID of the running node
102+
/// </summary>
103+
[DataMember(Name = "pid")]
57104
[JsonFormatter(typeof(NullableStringIntFormatter))]
58105
public int? ProcessId { get; set; }
59106

60-
[DataMember(Name ="queue")]
61-
[JsonFormatter(typeof(StringIntFormatter))]
62-
public int Queue { get; set; }
107+
/// <summary>
108+
/// The number of tasks in the queue for the current thread pool
109+
/// </summary>
110+
[DataMember(Name = "queue")]
111+
[JsonFormatter(typeof(StringLongFormatter))]
112+
public long Queue { get; set; }
63113

64-
[DataMember(Name ="queue_size")]
114+
/// <summary>
115+
/// The maximum number of tasks permitted in the queue for the current thread pool
116+
/// </summary>
117+
[DataMember(Name = "queue_size")]
65118
[JsonFormatter(typeof(NullableStringIntFormatter))]
66119
public int? QueueSize { get; set; }
67120

68-
[DataMember(Name ="rejected")]
121+
/// <summary>
122+
/// The number of tasks rejected by the thread pool executor
123+
/// </summary>
124+
[DataMember(Name = "rejected")]
69125
[JsonFormatter(typeof(StringLongFormatter))]
70126
public long Rejected { get; set; }
71127

72-
[DataMember(Name ="size")]
128+
/// <summary>
129+
/// The configured fixed number of active threads allowed in the current thread pool
130+
/// </summary>
131+
[DataMember(Name = "size")]
73132
[JsonFormatter(typeof(NullableStringIntFormatter))]
74133
public int? Size { get; set; }
75134

76-
[DataMember(Name ="type")]
135+
/// <summary>
136+
/// The current (*) type of thread pool (`fixed` or `scaling`)
137+
/// </summary>
138+
[DataMember(Name = "type")]
77139
public string Type { get; set; }
78140
}
79141
}

src/Tests/Tests/Cat/CatThreadPool/CatThreadpoolApiTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ protected override void ExpectResponse(CatResponse<CatThreadPoolRecord> response
5757
{
5858
response.Records.Should().NotBeNull();
5959

60-
6160
foreach (var r in response.Records)
6261
{
6362
r.EphemeralNodeId.Should().NotBeNullOrWhiteSpace();

0 commit comments

Comments
 (0)