Search in sources :

Example 1 with ServerStateChangeEventHandler

use of com.navercorp.pinpoint.rpc.server.handler.ServerStateChangeEventHandler 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());
}
Also used : ServerStateChangeEventHandler(com.navercorp.pinpoint.rpc.server.handler.ServerStateChangeEventHandler) MonitoredExecutorService(com.navercorp.pinpoint.collector.monitor.MonitoredExecutorService) ExecutorService(java.util.concurrent.ExecutorService) MonitoredExecutorService(com.navercorp.pinpoint.collector.monitor.MonitoredExecutorService)

Example 2 with ServerStateChangeEventHandler

use of com.navercorp.pinpoint.rpc.server.handler.ServerStateChangeEventHandler in project pinpoint by naver.

the class AgentBaseDataReceiver method prepare.

private void prepare(PinpointServerAcceptor acceptor) {
    if (clusterService != null && clusterService.isEnable()) {
        ProfilerClusterManager profilerClusterManager = clusterService.getProfilerClusterManager();
        final ServerStateChangeEventHandler stateChangeEventHandler = new ClusterPointStateChangedEventHandler(channelPropertiesFactory, profilerClusterManager);
        logger.info("Add Cluster channel state change event handlers {}", stateChangeEventHandler);
        acceptor.addStateChangeEventHandler(stateChangeEventHandler);
    } else {
        logger.info("clusterService is disabled");
    }
    for (ServerStateChangeEventHandler channelStateChangeEventHandler : this.channelStateChangeEventHandlers) {
        logger.info("Add channel state change event handlers {}", channelStateChangeEventHandler);
        acceptor.addStateChangeEventHandler(channelStateChangeEventHandler);
    }
}
Also used : ServerStateChangeEventHandler(com.navercorp.pinpoint.rpc.server.handler.ServerStateChangeEventHandler) ProfilerClusterManager(com.navercorp.pinpoint.collector.cluster.ProfilerClusterManager) ClusterPointStateChangedEventHandler(com.navercorp.pinpoint.collector.cluster.ClusterPointStateChangedEventHandler)

Aggregations

ServerStateChangeEventHandler (com.navercorp.pinpoint.rpc.server.handler.ServerStateChangeEventHandler)2 ClusterPointStateChangedEventHandler (com.navercorp.pinpoint.collector.cluster.ClusterPointStateChangedEventHandler)1 ProfilerClusterManager (com.navercorp.pinpoint.collector.cluster.ProfilerClusterManager)1 MonitoredExecutorService (com.navercorp.pinpoint.collector.monitor.MonitoredExecutorService)1 ExecutorService (java.util.concurrent.ExecutorService)1