@Test @SuppressWarnings("deprecation") public void testCachedExecutorMetricsRecorded() { String executorName = UUID.randomUUID().toString(); TaggedMetricRegistry metrics = SharedTaggedMetricRegistries.getSingleton(); withExecutor(() -> PTExecutors.newCachedThreadPool(executorName), executor -> { executor.submit(Runnables.doNothing()); }); Meter submitted = findMetric(metrics, MetricName.builder() .safeName("executor.submitted") .putSafeTags("executor", executorName) .build(), Meter.class); assertThat(submitted.getCount()).isOne(); }
public static ExecutorService newCachedThreadPool() { return newCachedThreadPool(computeBaseThreadName()); }
PTExecutors { public static ExecutorService newCachedThreadPool() { return newCachedThreadPool(computeBaseThreadName()); } }
PTExecutors { public static ExecutorService newCachedThreadPool() { return newCachedThreadPool(computeBaseThreadName()); } private  PTExecutors(); }
PTExecutors { public static ExecutorService newCachedThreadPool() { return newCachedThreadPool(computeBaseThreadName()); } private  PTExecutors(); static ExecutorService newCachedThreadPool(); static ExecutorService newCachedThreadPool(String name); @Deprecated static ExecutorService newCachedThreadPool(ThreadFactory threadFactory); @Deprecated static ExecutorService newCachedThreadPool(ThreadFactory threadFactory, int threadTimeoutMillis); @Beta static ExecutorService newCachedThreadPoolWithMaxThreads(int maxThreads, String name); static ExecutorService newFixedThreadPool(int numThreads); @Deprecated static ThreadPoolExecutor newFixedThreadPool(int numThreads, ThreadFactory threadFactory); static ExecutorService newFixedThreadPool(int numThreads, String name); static ScheduledThreadPoolExecutor newScheduledThreadPool(int corePoolSize); static ScheduledThreadPoolExecutor newScheduledThreadPool(int corePoolSize,
            ThreadFactory threadFactory); static ExecutorService newSingleThreadExecutor(); static ExecutorService newSingleThreadExecutor(boolean isDaemon); @Deprecated static ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory); static ScheduledExecutorService newSingleThreadScheduledExecutor(); static ScheduledExecutorService newSingleThreadScheduledExecutor(ThreadFactory threadFactory); static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue); static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue,
            ThreadFactory threadFactory); static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue,
            RejectedExecutionHandler handler); @SuppressWarnings("DangerousThreadPoolExecutorUsage") static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue,
            ThreadFactory threadFactory, RejectedExecutionHandler handler); static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize); static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize,
            ThreadFactory threadFactory); static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize,
            RejectedExecutionHandler handler); @SuppressWarnings("DangerousThreadPoolExecutorUsage") static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize,
            ThreadFactory threadFactory, RejectedExecutionHandler handler); static ExecutorService wrap(final String operationName, final ExecutorService executorService); static ExecutorService wrap(final ExecutorService executorService); static ScheduledExecutorService wrap(
            final String operationName,
            final ScheduledExecutorService scheduledExecutorService); static ScheduledExecutorService wrap(final ScheduledExecutorService scheduledExecutorService); static Runnable wrap(final Runnable runnable); static Runnable wrap(final String operationName, final Runnable runnable); static RunnableFuture<T> wrap(RunnableFuture<T> rf); static Callable<T> wrap(final String operationName, final Callable<? extends T> callable); static Callable<T> wrap(final Callable<? extends T> callable); static Collection<Callable<T>> wrap(
            Collection<? extends Callable<? extends T>> tasks); static ThreadFactory newNamedThreadFactory(); static ThreadFactory newNamedThreadFactory(boolean isDaemon); static ThreadFactory newNamedThreadFactory(boolean isDaemon, Class<?> classToIgnore); static ThreadFactory newThreadFactory(final String prefix, final int priority, final boolean isDaemon); }
PTExecutors { public static ExecutorService newCachedThreadPool() { return newCachedThreadPool(computeBaseThreadName()); } private  PTExecutors(); static ExecutorService newCachedThreadPool(); static ExecutorService newCachedThreadPool(String name); @Deprecated static ExecutorService newCachedThreadPool(ThreadFactory threadFactory); @Deprecated static ExecutorService newCachedThreadPool(ThreadFactory threadFactory, int threadTimeoutMillis); @Beta static ExecutorService newCachedThreadPoolWithMaxThreads(int maxThreads, String name); static ExecutorService newFixedThreadPool(int numThreads); @Deprecated static ThreadPoolExecutor newFixedThreadPool(int numThreads, ThreadFactory threadFactory); static ExecutorService newFixedThreadPool(int numThreads, String name); static ScheduledThreadPoolExecutor newScheduledThreadPool(int corePoolSize); static ScheduledThreadPoolExecutor newScheduledThreadPool(int corePoolSize,
            ThreadFactory threadFactory); static ExecutorService newSingleThreadExecutor(); static ExecutorService newSingleThreadExecutor(boolean isDaemon); @Deprecated static ExecutorService newSingleThreadExecutor(ThreadFactory threadFactory); static ScheduledExecutorService newSingleThreadScheduledExecutor(); static ScheduledExecutorService newSingleThreadScheduledExecutor(ThreadFactory threadFactory); static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue); static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue,
            ThreadFactory threadFactory); static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue,
            RejectedExecutionHandler handler); @SuppressWarnings("DangerousThreadPoolExecutorUsage") static ThreadPoolExecutor newThreadPoolExecutor(int corePoolSize, int maximumPoolSize,
            long keepAliveTime, TimeUnit unit, BlockingQueue<Runnable> workQueue,
            ThreadFactory threadFactory, RejectedExecutionHandler handler); static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize); static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize,
            ThreadFactory threadFactory); static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize,
            RejectedExecutionHandler handler); @SuppressWarnings("DangerousThreadPoolExecutorUsage") static ScheduledThreadPoolExecutor newScheduledThreadPoolExecutor(int corePoolSize,
            ThreadFactory threadFactory, RejectedExecutionHandler handler); static ExecutorService wrap(final String operationName, final ExecutorService executorService); static ExecutorService wrap(final ExecutorService executorService); static ScheduledExecutorService wrap(
            final String operationName,
            final ScheduledExecutorService scheduledExecutorService); static ScheduledExecutorService wrap(final ScheduledExecutorService scheduledExecutorService); static Runnable wrap(final Runnable runnable); static Runnable wrap(final String operationName, final Runnable runnable); static RunnableFuture<T> wrap(RunnableFuture<T> rf); static Callable<T> wrap(final String operationName, final Callable<? extends T> callable); static Callable<T> wrap(final Callable<? extends T> callable); static Collection<Callable<T>> wrap(
            Collection<? extends Callable<? extends T>> tasks); static ThreadFactory newNamedThreadFactory(); static ThreadFactory newNamedThreadFactory(boolean isDaemon); static ThreadFactory newNamedThreadFactory(boolean isDaemon, Class<?> classToIgnore); static ThreadFactory newThreadFactory(final String prefix, final int priority, final boolean isDaemon);  }