gortiz commented on code in PR #15189:
URL: https://github.com/apache/pinot/pull/15189#discussion_r1987217776


##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/JmxMetricsIntegrationTest.java:
##########
@@ -138,6 +153,39 @@ public void testMultiStageMigrationMetric() throws 
Exception {
     assertEquals((Long) MBEAN_SERVER.getAttribute(multiStageMigrationMetric, 
"Count"), 6L);
   }
 
+  @Test
+  public void testEstimatedMseServerThreadsBrokerMetric() throws Exception {
+    ObjectName estimatedMseServerThreadsMetric = new 
ObjectName(PINOT_JMX_METRICS_DOMAIN,
+        new Hashtable<>(Map.of("type", BROKER_METRICS_TYPE,
+            "name", "\"pinot.broker.estimatedMseServerThreads\"")));
+
+    assertEquals((Long) 
MBEAN_SERVER.getAttribute(estimatedMseServerThreadsMetric, "Value"), 0L);
+
+    ExecutorService executorService = Executors.newSingleThreadExecutor();
+
+    executorService.submit(() -> {
+      while (true) {
+        try {
+          postQuery(
+              "SET useMultiStageEngine=true; SELECT AirlineID, AVG(ArrDelay) 
FILTER (WHERE ArrDelay > 0) FROM mytable"
+                  + " GROUP BY AirlineID;");

Review Comment:
   Nit: You can use the sleep function to be sure the query keeps running for a 
while, increasing the chance of finding a thread running in the check below.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to