|
51 | 51 | import com.linkedin.venice.server.VeniceServerContext; |
52 | 52 | import com.linkedin.venice.servicediscovery.ServiceDiscoveryAnnouncer; |
53 | 53 | import com.linkedin.venice.tehuti.MetricsAware; |
| 54 | +import com.linkedin.venice.tehuti.MockTehutiReporter; |
54 | 55 | import com.linkedin.venice.utils.ForkedJavaProcess; |
55 | 56 | import com.linkedin.venice.utils.PropertyBuilder; |
56 | 57 | import com.linkedin.venice.utils.SslUtils; |
57 | 58 | import com.linkedin.venice.utils.TestUtils; |
58 | 59 | import com.linkedin.venice.utils.Utils; |
59 | 60 | import com.linkedin.venice.utils.VeniceProperties; |
60 | 61 | import com.linkedin.venice.utils.metrics.MetricsRepositoryUtils; |
| 62 | +import io.tehuti.Metric; |
61 | 63 | import io.tehuti.metrics.MetricsRepository; |
62 | 64 | import java.io.File; |
63 | 65 | import java.io.IOException; |
|
78 | 80 | import org.apache.commons.io.FileUtils; |
79 | 81 | import org.apache.logging.log4j.LogManager; |
80 | 82 | import org.apache.logging.log4j.Logger; |
| 83 | +import org.testng.Assert; |
81 | 84 |
|
82 | 85 |
|
83 | 86 | /** |
@@ -454,12 +457,28 @@ protected void internalStart() throws Exception { |
454 | 457 | @Override |
455 | 458 | protected void internalStop() throws Exception { |
456 | 459 | if (!forkServer) { |
| 460 | + verifyHelixParticipantServicePoolMetricsReporting(veniceServer); |
457 | 461 | veniceServer.shutdown(); |
458 | 462 | } else { |
459 | 463 | serverProcess.destroy(); |
460 | 464 | } |
461 | 465 | } |
462 | 466 |
|
| 467 | + private void verifyHelixParticipantServicePoolMetricsReporting(VeniceServer veniceServer) { |
| 468 | + MetricsRepository metricsRepository = veniceServer.getMetricsRepository(); |
| 469 | + MockTehutiReporter reporter = new MockTehutiReporter(); |
| 470 | + metricsRepository.addReporter(reporter); |
| 471 | + Metric activeThreadNumber = reporter.query(".Venice_L/F_ST_thread_pool--active_thread_number.LambdaStat"); |
| 472 | + Assert.assertNotNull(activeThreadNumber); |
| 473 | + Assert.assertTrue(activeThreadNumber.value() >= 0); |
| 474 | + Metric maxThreadNumber = reporter.query(".Venice_L/F_ST_thread_pool--max_thread_number.LambdaStat"); |
| 475 | + Assert.assertNotNull(maxThreadNumber); |
| 476 | + Assert.assertTrue(maxThreadNumber.value() > 0); |
| 477 | + Metric queuedTaskNumber = reporter.query(".Venice_L/F_ST_thread_pool--queued_task_number.LambdaStat"); |
| 478 | + Assert.assertNotNull(queuedTaskNumber); |
| 479 | + Assert.assertTrue(queuedTaskNumber.value() >= 0); |
| 480 | + } |
| 481 | + |
463 | 482 | @Override |
464 | 483 | protected void newProcess() throws Exception { |
465 | 484 | if (forkServer) { |
|
0 commit comments