@Test public void metricsGathered() throws Exception { String unit = "queue1"; String[] labelValues = {unit}; new QueuedThreadPoolStatisticsCollector(queuedThreadPool, unit).register(); server.start(); assertTrue( CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_threads", LABEL_NAMES, labelValues) > 0); assertTrue( CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_threads_idle", LABEL_NAMES, labelValues) > 0); assertTrue( CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_threads_max", LABEL_NAMES, labelValues) == 200); assertNotNull(CollectorRegistry.defaultRegistry.getSampleValue("jetty_queued_thread_pool_jobs", LABEL_NAMES, labelValues)); }
@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);  }