@@ -70,13 +70,12 @@ public String toString() {
70
70
*
71
71
* @param totalThreadPoolThreads Total number of threads in the thread pool.
72
72
* @param averageThreadPoolUtilization Percent of thread pool threads that are in use, averaged over some period of time.
73
- * @param averageThreadPoolQueueLatencyMillis How much time tasks spend in the thread pool queue. Zero if there is nothing being queued
74
- * in the write thread pool.
73
+ * @param maxThreadPoolQueueLatencyMillis The max time any task has spent in the thread pool queue. Zero if no task is queued.
75
74
*/
76
75
public record ThreadPoolUsageStats (
77
76
int totalThreadPoolThreads ,
78
77
float averageThreadPoolUtilization ,
79
- long averageThreadPoolQueueLatencyMillis
78
+ long maxThreadPoolQueueLatencyMillis
80
79
) implements Writeable {
81
80
82
81
public ThreadPoolUsageStats (StreamInput in ) throws IOException {
@@ -87,12 +86,12 @@ public ThreadPoolUsageStats(StreamInput in) throws IOException {
87
86
public void writeTo (StreamOutput out ) throws IOException {
88
87
out .writeVInt (this .totalThreadPoolThreads );
89
88
out .writeFloat (this .averageThreadPoolUtilization );
90
- out .writeVLong (this .averageThreadPoolQueueLatencyMillis );
89
+ out .writeVLong (this .maxThreadPoolQueueLatencyMillis );
91
90
}
92
91
93
92
@ Override
94
93
public int hashCode () {
95
- return Objects .hash (totalThreadPoolThreads , averageThreadPoolUtilization , averageThreadPoolQueueLatencyMillis );
94
+ return Objects .hash (totalThreadPoolThreads , averageThreadPoolUtilization , maxThreadPoolQueueLatencyMillis );
96
95
}
97
96
98
97
@ Override
@@ -101,8 +100,8 @@ public String toString() {
101
100
+ totalThreadPoolThreads
102
101
+ ", averageThreadPoolUtilization="
103
102
+ averageThreadPoolUtilization
104
- + ", averageThreadPoolQueueLatencyMillis ="
105
- + averageThreadPoolQueueLatencyMillis
103
+ + ", maxThreadPoolQueueLatencyMillis ="
104
+ + maxThreadPoolQueueLatencyMillis
106
105
+ "]" ;
107
106
}
108
107
@@ -113,7 +112,7 @@ public boolean equals(Object o) {
113
112
ThreadPoolUsageStats other = (ThreadPoolUsageStats ) o ;
114
113
return totalThreadPoolThreads == other .totalThreadPoolThreads
115
114
&& averageThreadPoolUtilization == other .averageThreadPoolUtilization
116
- && averageThreadPoolQueueLatencyMillis == other .averageThreadPoolQueueLatencyMillis ;
115
+ && maxThreadPoolQueueLatencyMillis == other .maxThreadPoolQueueLatencyMillis ;
117
116
}
118
117
119
118
} // ThreadPoolUsageStats
0 commit comments