Search in sources :

Example 1 with DatagramPacketFactory

use of com.navercorp.pinpoint.collector.util.DatagramPacketFactory 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));
}
Also used : MonitoredExecutorService(com.navercorp.pinpoint.collector.monitor.MonitoredExecutorService) DatagramPacketFactory(com.navercorp.pinpoint.collector.util.DatagramPacketFactory) PinpointThreadFactory(com.navercorp.pinpoint.common.util.PinpointThreadFactory)

Example 2 with DatagramPacketFactory

use of com.navercorp.pinpoint.collector.util.DatagramPacketFactory 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));
}
Also used : DatagramPacketFactory(com.navercorp.pinpoint.collector.util.DatagramPacketFactory) PinpointThreadFactory(com.navercorp.pinpoint.common.util.PinpointThreadFactory)

Aggregations

DatagramPacketFactory (com.navercorp.pinpoint.collector.util.DatagramPacketFactory)2 PinpointThreadFactory (com.navercorp.pinpoint.common.util.PinpointThreadFactory)2 MonitoredExecutorService (com.navercorp.pinpoint.collector.monitor.MonitoredExecutorService)1