Skip to content

Commit c1cfd79

Browse files
committed
Update docs for new metrics and some existing ones. Add test
1 parent 1cce508 commit c1cfd79

File tree

3 files changed

+13
-5
lines changed

3 files changed

+13
-5
lines changed

docs/operations/metrics.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,10 +149,13 @@ to represent the task ID are deprecated and will be removed in a future release.
149149
|Metric|Description|Normal value|
150150
|------|-----------|------------|
151151
|`jetty/numOpenConnections`|Number of open jetty connections.|Not much higher than number of jetty threads.|
152-
|`jetty/threadPool/total`|Number of total workable threads allocated.|The number should equal to `threadPoolNumIdleThreads` + `threadPoolNumBusyThreads`.|
153-
|`jetty/threadPool/idle`|Number of idle threads.|Less than or equal to `threadPoolNumTotalThreads`. Non zero number means there is less work to do than configured capacity.|
154-
|`jetty/threadPool/busy`|Number of busy threads that has work to do from the worker queue.|Less than or equal to `threadPoolNumTotalThreads`.|
155-
|`jetty/threadPool/isLowOnThreads`|A rough indicator of whether number of total workable threads allocated is enough to handle the works in the work queue.|0|
152+
|`jetty/threadPool/total`|Number of total workable threads allocated. This includes internal threads and threads that are ready to serve requests.|Equals the total number of usable threads in the Jetty thread pool (idle + busy).|
153+
|`jetty/threadPool/ready`| Number of threads that are ready to serve requests. | Equals the total number of usable threads in the Jetty thread pool to serve requests (idle + busy).|
154+
|`jetty/threadPool/utilized`| Number of threads currently in use by the thread pool to serve requests. | Typically well below ready.|
155+
|`jetty/threadPool/utilizationRate`| Fraction of thread pool capacity currently in use to serve requests. | A value of 0.0 means that the thread pool is not utilized, while a value of 1.0 means that the thread pool is fully utilized.|
156+
|`jetty/threadPool/idle`|Number of idle threads.|Less than or equal to the total number of usable threads. A non-zero value means there is less work to do than configured capacity.|
157+
|`jetty/threadPool/busy`|Number of busy threads that have work to do from the worker queue.|Less than or equal to the total number of usable threads.|
158+
|`jetty/threadPool/isLowOnThreads`|A rough indicator of whether the number of total workable threads allocated is enough to handle the work in the work queue.|0|
156159
|`jetty/threadPool/min`|Number of minimum threads allocatable.|`druid.server.http.numThreads` plus a small fixed number of threads allocated for Jetty acceptors and selectors.|
157160
|`jetty/threadPool/max`|Number of maximum threads allocatable.|`druid.server.http.numThreads` plus a small fixed number of threads allocated for Jetty acceptors and selectors.|
158161
|`jetty/threadPool/queueSize`|Size of the worker queue.|Not much higher than `druid.server.http.queueSize`.|

server/src/main/java/org/apache/druid/server/initialization/jetty/JettyServerModule.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@
6767
import org.eclipse.jetty.server.ServerConnector;
6868
import org.eclipse.jetty.server.SslConnectionFactory;
6969
import org.eclipse.jetty.server.handler.ErrorHandler;
70-
import org.eclipse.jetty.server.handler.QoSHandler;
7170
import org.eclipse.jetty.util.Callback;
7271
import org.eclipse.jetty.util.component.LifeCycle;
7372
import org.eclipse.jetty.util.ssl.KeyStoreScanner;

server/src/test/java/org/apache/druid/server/initialization/jetty/JettyServerModuleTest.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ public void testJettyServerModule()
5353
Mockito.when(jettyServerThreadPool.getMaxThreads()).thenReturn(100);
5454
Mockito.when(jettyServerThreadPool.getQueueSize()).thenReturn(50);
5555
Mockito.when(jettyServerThreadPool.getBusyThreads()).thenReturn(60);
56+
Mockito.when(jettyServerThreadPool.getReadyThreads()).thenReturn(20);
57+
Mockito.when(jettyServerThreadPool.getUtilizedThreads()).thenReturn(5);
58+
Mockito.when(jettyServerThreadPool.getUtilizationRate()).thenReturn(0.45);
5659

5760
JettyServerModule.JettyMonitor jettyMonitor = new JettyServerModule.JettyMonitor();
5861

@@ -67,6 +70,9 @@ public void testJettyServerModule()
6770
serviceEmitter.verifyValue("jetty/threadPool/max", 100);
6871
serviceEmitter.verifyValue("jetty/threadPool/queueSize", 50);
6972
serviceEmitter.verifyValue("jetty/threadPool/busy", 60);
73+
serviceEmitter.verifyValue("jetty/threadPool/ready", 20);
74+
serviceEmitter.verifyValue("jetty/threadPool/utilized", 5);
75+
serviceEmitter.verifyValue("jetty/threadPool/utilizationRate", 0.45);
7076
}
7177

7278
@Test

0 commit comments

Comments
 (0)