@Test public void shouldFailIfNoQueueThreadPoolsAreRegistered() { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("QueuedThreadPool"); new QueuedThreadPoolStatisticsCollector().register(); }
@Override public <T extends Collector> T register(CollectorRegistry registry) { if (queuedThreadPoolMap.isEmpty()) { throw new IllegalStateException("You must register at least one QueuedThreadPool."); } return super.register(registry); }
QueuedThreadPoolStatisticsCollector extends Collector { @Override public <T extends Collector> T register(CollectorRegistry registry) { if (queuedThreadPoolMap.isEmpty()) { throw new IllegalStateException("You must register at least one QueuedThreadPool."); } return super.register(registry); } }
QueuedThreadPoolStatisticsCollector extends Collector { @Override public <T extends Collector> T register(CollectorRegistry registry) { if (queuedThreadPoolMap.isEmpty()) { throw new IllegalStateException("You must register at least one QueuedThreadPool."); } return super.register(registry); } QueuedThreadPoolStatisticsCollector();  QueuedThreadPoolStatisticsCollector(QueuedThreadPool queuedThreadPool, String name); }
QueuedThreadPoolStatisticsCollector extends Collector { @Override public <T extends Collector> T register(CollectorRegistry registry) { if (queuedThreadPoolMap.isEmpty()) { throw new IllegalStateException("You must register at least one QueuedThreadPool."); } return super.register(registry); } QueuedThreadPoolStatisticsCollector();  QueuedThreadPoolStatisticsCollector(QueuedThreadPool queuedThreadPool, String name); QueuedThreadPoolStatisticsCollector add(QueuedThreadPool queuedThreadPool, String name); @Override List<MetricFamilySamples> collect(); @Override T register(CollectorRegistry registry); }
QueuedThreadPoolStatisticsCollector extends Collector { @Override public <T extends Collector> T register(CollectorRegistry registry) { if (queuedThreadPoolMap.isEmpty()) { throw new IllegalStateException("You must register at least one QueuedThreadPool."); } return super.register(registry); } QueuedThreadPoolStatisticsCollector();  QueuedThreadPoolStatisticsCollector(QueuedThreadPool queuedThreadPool, String name); QueuedThreadPoolStatisticsCollector add(QueuedThreadPool queuedThreadPool, String name); @Override List<MetricFamilySamples> collect(); @Override T register(CollectorRegistry registry);  }