HystrixThreadPoolMetrics extends HystrixMetrics { public static Collection<HystrixThreadPoolMetrics> getInstances() { List<HystrixThreadPoolMetrics> threadPoolMetrics = new ArrayList<HystrixThreadPoolMetrics>(); for (HystrixThreadPoolMetrics tpm: metrics.values()) { if (hasExecutedCommandsOnThread(tpm)) { threadPoolMetrics.add(tpm); } } return Collections.unmodifiableCollection(threadPoolMetrics); } private  HystrixThreadPoolMetrics(HystrixThreadPoolKey threadPoolKey, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties); static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties); static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key); static Collection<HystrixThreadPoolMetrics> getInstances(); ThreadPoolExecutor getThreadPool(); HystrixThreadPoolKey getThreadPoolKey(); HystrixThreadPoolProperties getProperties(); Number getCurrentActiveCount(); Number getCurrentCompletedTaskCount(); Number getCurrentCorePoolSize(); Number getCurrentLargestPoolSize(); Number getCurrentMaximumPoolSize(); Number getCurrentPoolSize(); Number getCurrentTaskCount(); Number getCurrentQueueSize(); void markThreadExecution(); long getRollingCountThreadsExecuted(); long getCumulativeCountThreadsExecuted(); long getRollingCountThreadsRejected(); long getCumulativeCountThreadsRejected(); long getRollingCount(HystrixEventType.ThreadPool event); long getCumulativeCount(HystrixEventType.ThreadPool event); @Override long getCumulativeCount(HystrixRollingNumberEvent event); @Override long getRollingCount(HystrixRollingNumberEvent event); void markThreadCompletion(); long getRollingMaxActiveThreads(); void markThreadRejection(); static Func0<Integer> getCurrentConcurrencyThunk(final HystrixThreadPoolKey threadPoolKey); static final Func2<long[], HystrixCommandCompletion, long[]> appendEventToBucket; static final Func2<long[], long[], long[]> counterAggregator; }
@Test public void shouldYieldNoExecutedTasksOnStartup() throws Exception { final Collection<HystrixThreadPoolMetrics> instances = HystrixThreadPoolMetrics.getInstances(); assertEquals(0, instances.size()); }