Java 类com.codahale.metrics.InstrumentedExecutorService 实例源码

项目:graylog-plugin-beats    文件:BeatsTransport.java   
private static Executor executorService(final String executorName, final String threadNameFormat, final MetricRegistry metricRegistry) {
    final ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat(threadNameFormat).build();
    return new InstrumentedExecutorService(
            Executors.newCachedThreadPool(threadFactory),
            metricRegistry,
            name(BeatsTransport.class, executorName, "executor-service"));
}
项目:flux    文件:MessageManagerService.java   
@Inject
public MessageManagerService(MessageDao messageDao,
                             @Named("redriver.noOfPersistenceWorkers") int noOfPersistenceWorkers,
                             @Named("redriver.batchDelete.intervalms") Integer batchDeleteInterval,
                             @Named("redriver.batchDelete.batchSize") Integer batchSize) {
    this.messageDao = messageDao;
    this.batchDeleteInterval = batchDeleteInterval;
    this.batchSize = batchSize;
    this.messagesToDelete = new ConcurrentLinkedQueue<>();
    scheduledDeletionService =
        new InstrumentedScheduledExecutorService(Executors.newScheduledThreadPool(2), SharedMetricRegistries.getOrCreate(METRIC_REGISTRY_NAME), scheduledDeletionSvcName);
    persistenceExecutorService =
        new InstrumentedExecutorService(Executors.newFixedThreadPool(noOfPersistenceWorkers), SharedMetricRegistries.getOrCreate(METRIC_REGISTRY_NAME), taskRegisterSvcName);
}