Search in sources :

Example 16 with PinpointClient

use of com.navercorp.pinpoint.rpc.client.PinpointClient in project pinpoint by naver.

the class PluginApplicationContextModule method configure.

@Override
protected void configure() {
    final DataSender spanDataSender = newUdpSpanDataSender();
    logger.debug("spanDataSender:{}", spanDataSender);
    bind(DataSender.class).annotatedWith(SpanDataSender.class).toInstance(spanDataSender);
    final DataSender statDataSender = newUdpStatDataSender();
    logger.debug("statDataSender:{}", statDataSender);
    bind(DataSender.class).annotatedWith(StatDataSender.class).toInstance(statDataSender);
    StorageFactory storageFactory = newStorageFactory(spanDataSender);
    logger.debug("spanFactory:{}", spanDataSender);
    bind(StorageFactory.class).toInstance(storageFactory);
    bind(PinpointClientFactory.class).toProvider(Providers.of((PinpointClientFactory) null));
    bind(PinpointClient.class).toProvider(Providers.of((PinpointClient) null));
    EnhancedDataSender enhancedDataSender = newTcpDataSender();
    logger.debug("enhancedDataSender:{}", enhancedDataSender);
    bind(EnhancedDataSender.class).toInstance(enhancedDataSender);
    ServerMetaDataHolder serverMetaDataHolder = newServerMetaDataHolder();
    logger.debug("serverMetaDataHolder:{}", serverMetaDataHolder);
    bind(ServerMetaDataHolder.class).toInstance(serverMetaDataHolder);
}
Also used : SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) DataSender(com.navercorp.pinpoint.profiler.sender.DataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Example 17 with PinpointClient

use of com.navercorp.pinpoint.rpc.client.PinpointClient in project pinpoint by naver.

the class ClusterTest method clusterTest3.

@Test
public void clusterTest3() throws Exception {
    PinpointClientFactory clientFactory = null;
    PinpointClient client = null;
    ZooKeeper zookeeper = null;
    try {
        zookeeper = new ZooKeeper(zookeeperAddress, 5000, null);
        awaitZookeeperConnected(zookeeper);
        Assert.assertEquals(0, clusterConnectionManager.getClusterList().size());
        clientFactory = new DefaultPinpointClientFactory();
        clientFactory.setMessageListener(SimpleMessageListener.INSTANCE);
        client = clientFactory.connect(DEFAULT_IP, acceptorPort);
        awaitPinpointClientConnected(clusterConnectionManager);
        Assert.assertEquals(1, clusterConnectionManager.getClusterList().size());
    } finally {
        closePinpointSocket(clientFactory, client);
        if (zookeeper != null) {
            zookeeper.close();
        }
    }
}
Also used : DefaultPinpointClientFactory(com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory) PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) ZooKeeper(org.apache.zookeeper.ZooKeeper) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) DefaultPinpointClientFactory(com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory) Test(org.junit.Test)

Example 18 with PinpointClient

use of com.navercorp.pinpoint.rpc.client.PinpointClient in project pinpoint by naver.

the class MockApplicationContextModule method configure.

@Override
protected void configure() {
    final DataSender spanDataSender = newUdpSpanDataSender();
    logger.debug("spanDataSender:{}", spanDataSender);
    bind(DataSender.class).annotatedWith(SpanDataSender.class).toInstance(spanDataSender);
    final DataSender statDataSender = newUdpStatDataSender();
    logger.debug("statDataSender:{}", statDataSender);
    bind(DataSender.class).annotatedWith(StatDataSender.class).toInstance(statDataSender);
    StorageFactory storageFactory = newStorageFactory(spanDataSender);
    logger.debug("spanFactory:{}", spanDataSender);
    bind(StorageFactory.class).toInstance(storageFactory);
    bind(PinpointClientFactory.class).toProvider(Providers.of((PinpointClientFactory) null));
    bind(PinpointClient.class).toProvider(Providers.of((PinpointClient) null));
    EnhancedDataSender enhancedDataSender = newTcpDataSender();
    logger.debug("enhancedDataSender:{}", enhancedDataSender);
    bind(EnhancedDataSender.class).toInstance(enhancedDataSender);
    ServerMetaDataHolder serverMetaDataHolder = newServerMetaDataHolder();
    logger.debug("serverMetaDataHolder:{}", serverMetaDataHolder);
    bind(ServerMetaDataHolder.class).toInstance(serverMetaDataHolder);
    bind(PluginContextLoadResult.class).toProvider(MockPluginContextLoadResultProvider.class).in(Scopes.SINGLETON);
}
Also used : SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) SpanDataSender(com.navercorp.pinpoint.profiler.context.module.SpanDataSender) StatDataSender(com.navercorp.pinpoint.profiler.context.module.StatDataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) DataSender(com.navercorp.pinpoint.profiler.sender.DataSender) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) ServerMetaDataHolder(com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)

Example 19 with PinpointClient

use of com.navercorp.pinpoint.rpc.client.PinpointClient in project pinpoint by naver.

the class PinpointClientProvider method get.

@Override
public PinpointClient get() {
    PinpointClientFactory pinpointClientFactory = clientFactory.get();
    PinpointClient pinpointClient = ClientFactoryUtils.createPinpointClient(profilerConfig.getCollectorTcpServerIp(), profilerConfig.getCollectorTcpServerPort(), pinpointClientFactory);
    return pinpointClient;
}
Also used : PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory)

Example 20 with PinpointClient

use of com.navercorp.pinpoint.rpc.client.PinpointClient in project pinpoint by naver.

the class DefaultApplicationContext method closeTcpDataSender.

private void closeTcpDataSender() {
    final EnhancedDataSender tcpDataSender = this.tcpDataSender;
    if (tcpDataSender != null) {
        tcpDataSender.stop();
    }
    final PinpointClient client = this.client;
    if (client != null) {
        client.close();
    }
    final PinpointClientFactory clientFactory = this.clientFactory;
    if (clientFactory != null) {
        clientFactory.release();
    }
}
Also used : PinpointClient(com.navercorp.pinpoint.rpc.client.PinpointClient) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)

Aggregations

PinpointClient (com.navercorp.pinpoint.rpc.client.PinpointClient)29 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)28 Test (org.junit.Test)22 DefaultPinpointClientFactory (com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory)19 PinpointServerAcceptor (com.navercorp.pinpoint.rpc.server.PinpointServerAcceptor)16 TcpDataSender (com.navercorp.pinpoint.profiler.sender.TcpDataSender)9 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)9 PinpointSocket (com.navercorp.pinpoint.rpc.PinpointSocket)5 ServerMetaDataHolder (com.navercorp.pinpoint.bootstrap.context.ServerMetaDataHolder)3 EnhancedDataSender (com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)3 ArrayList (java.util.ArrayList)3 CountDownLatch (java.util.concurrent.CountDownLatch)3 SpanDataSender (com.navercorp.pinpoint.profiler.context.module.SpanDataSender)2 StatDataSender (com.navercorp.pinpoint.profiler.context.module.StatDataSender)2 StorageFactory (com.navercorp.pinpoint.profiler.context.storage.StorageFactory)2 DataSender (com.navercorp.pinpoint.profiler.sender.DataSender)2 TestAwaitTaskUtils (com.navercorp.pinpoint.rpc.TestAwaitTaskUtils)2 PinpointClientReconnectEventListener (com.navercorp.pinpoint.rpc.client.PinpointClientReconnectEventListener)2 PinpointServer (com.navercorp.pinpoint.rpc.server.PinpointServer)2 TApiMetaData (com.navercorp.pinpoint.thrift.dto.TApiMetaData)2