use of com.navercorp.pinpoint.collector.monitor.MonitoredExecutorService in project pinpoint by naver.
the class UDPReceiver method afterPropertiesSet.
public void afterPropertiesSet() {
Assert.notNull(metricRegistry, "metricRegistry must not be null");
Assert.notNull(packetHandlerFactory, "packetHandlerFactory must not be null");
this.worker = createWorker(workerOption, receiverName + "-Worker");
if (workerOption.isEnableCollectMetric()) {
this.worker = new MonitoredExecutorService(worker, metricRegistry, receiverName + "-Worker");
}
final int packetPoolSize = getPacketPoolSize(workerOption);
this.datagramPacketPool = new DefaultObjectPool<>(new DatagramPacketFactory(), packetPoolSize);
this.io = (ThreadPoolExecutor) Executors.newCachedThreadPool(new PinpointThreadFactory(receiverName + "-Io", true));
}
use of com.navercorp.pinpoint.collector.monitor.MonitoredExecutorService in project pinpoint by naver.
the class TCPReceiver method afterPropertiesSet.
public void afterPropertiesSet() {
ExecutorService worker = ExecutorFactory.newFixedThreadPool(configuration.getTcpWorkerThread(), configuration.getTcpWorkerQueueSize(), tcpWorkerThreadFactory);
if (configuration.isTcpWorkerMonitor()) {
if (metricRegistry == null) {
logger.warn("metricRegistry not autowired. Can't enable monitoring.");
this.worker = worker;
} else {
this.worker = new MonitoredExecutorService(worker, metricRegistry, this.getClass().getSimpleName() + "-Worker");
}
} else {
this.worker = worker;
}
if (clusterService != null && clusterService.isEnable()) {
this.serverAcceptor.addStateChangeEventHandler(clusterService.getChannelStateChangeEventHandler());
}
for (ServerStateChangeEventHandler channelStateChangeEventHandler : this.channelStateChangeEventHandlers) {
serverAcceptor.addStateChangeEventHandler(channelStateChangeEventHandler);
}
setL4TcpChannel(serverAcceptor, configuration.getL4IpList());
}
Aggregations