use of com.navercorp.pinpoint.common.util.PinpointThreadFactory 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.common.util.PinpointThreadFactory in project pinpoint by naver.
the class TestUDPReceiver method afterPropertiesSet.
public void afterPropertiesSet() {
Assert.notNull(packetHandlerFactory, "packetHandlerFactory must not be null");
final int packetPoolSize = getPacketPoolSize(workerThreadSize, workerThreadQueueSize);
this.datagramPacketPool = new DefaultObjectPool<>(new DatagramPacketFactory(), packetPoolSize);
this.worker = ExecutorFactory.newFixedThreadPool(workerThreadSize, workerThreadQueueSize, receiverName + "-Worker", true);
this.io = (ThreadPoolExecutor) Executors.newCachedThreadPool(new PinpointThreadFactory(receiverName + "-Io", true));
}
use of com.navercorp.pinpoint.common.util.PinpointThreadFactory in project pinpoint by naver.
the class StandbySpanStreamDataSendWorker method start.
public void start() {
final ThreadFactory threadFactory = new PinpointThreadFactory(this.getClass().getSimpleName(), true);
this.workerThread = threadFactory.newThread(this);
logger.info("start() started.");
if (!workerThread.isAlive()) {
this.isStarted = true;
this.workerThread.start();
logger.info("start() completed.");
} else {
logger.info("start() failed. caused:already started.", this.getClass().getSimpleName());
}
}
use of com.navercorp.pinpoint.common.util.PinpointThreadFactory in project pinpoint by naver.
the class BufferedUdpDataSender method startScheduledFlush.
private Thread startScheduledFlush() {
final ThreadFactory threadFactory = new PinpointThreadFactory(SCHEDULED_FLUSH, true);
final Thread thread = threadFactory.newThread(new Runnable() {
@Override
public void run() {
final Thread currentThread = Thread.currentThread();
while (!currentThread.isInterrupted()) {
try {
chunkHeaderBufferedSerializer.flush();
} catch (TException e) {
logger.warn("Failed to flush. caused={}", e.getMessage(), e);
}
try {
TimeUnit.MILLISECONDS.sleep(1000);
} catch (InterruptedException ignored) {
currentThread.interrupt();
}
}
logger.info("stop ScheduledFlush {} - {}", currentThread.getName(), currentThread.getId());
}
});
logger.info("stop ScheduledFlush {} - {}", thread.getName(), thread.getId());
thread.start();
return thread;
}
use of com.navercorp.pinpoint.common.util.PinpointThreadFactory in project pinpoint by naver.
the class ActiveThreadCountHandler method start.
@Override
public void start() {
PinpointThreadFactory flushThreadFactory = new PinpointThreadFactory(ClassUtils.simpleClassName(this) + "-Flush-Thread", true);
webSocketFlushExecutor = new SimpleOrderedThreadPool(Runtime.getRuntime().availableProcessors(), 65535, flushThreadFactory);
flushTimer = new java.util.Timer(ClassUtils.simpleClassName(this) + "-Flush-Timer", true);
healthCheckTimer = new java.util.Timer(ClassUtils.simpleClassName(this) + "-HealthCheck-Timer", true);
reactiveTimer = new java.util.Timer(ClassUtils.simpleClassName(this) + "-Reactive-Timer", true);
}
Aggregations