Search in sources :

Example 6 with MetaDataType

use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.

the class AgentInfoSenderProvider method get.

@Override
public AgentInfoSender get() {
    final EnhancedDataSender<MetaDataType> enhancedDataSender = this.enhancedDataSenderProvider.get();
    final AgentInfoFactory agentInfoFactory = this.agentInfoFactoryProvider.get();
    final AgentInfoSender agentInfoSender = new AgentInfoSender.Builder(enhancedDataSender, agentInfoFactory).sendInterval(contextConfig.getAgentInfoSendRetryInterval()).setMessageConverter(this.messageConverter).build();
    serverMetaDataRegistryService.addListener(new ServerMetaDataRegistryService.OnChangeListener() {

        @Override
        public void onServerMetaDataChange() {
            agentInfoSender.refresh();
        }
    });
    return agentInfoSender;
}
Also used : MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) ServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService) AgentInfoFactory(com.navercorp.pinpoint.profiler.util.AgentInfoFactory) AgentInfoSender(com.navercorp.pinpoint.profiler.AgentInfoSender)

Example 7 with MetaDataType

use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.

the class TcpDataSenderProvider method get.

@Override
public EnhancedDataSender<MetaDataType> get() {
    PinpointClientFactory clientFactory = clientFactoryProvider.get();
    String collectorTcpServerIp = thriftTransportConfig.getCollectorTcpServerIp();
    int collectorTcpServerPort = thriftTransportConfig.getCollectorTcpServerPort();
    HeaderTBaseSerializer headerTBaseSerializer = tBaseSerializerProvider.get();
    MessageSerializer<MetaDataType, byte[]> messageSerializer = new ThriftMessageSerializer<>(messageConverter, headerTBaseSerializer);
    return new TcpDataSender<>("Default", collectorTcpServerIp, collectorTcpServerPort, clientFactory, messageSerializer);
}
Also used : HeaderTBaseSerializer(com.navercorp.pinpoint.thrift.io.HeaderTBaseSerializer) ThriftMessageSerializer(com.navercorp.pinpoint.profiler.sender.ThriftMessageSerializer) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) TcpDataSender(com.navercorp.pinpoint.profiler.sender.TcpDataSender)

Example 8 with MetaDataType

use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.

the class PluginApplicationContextModule method configure.

@Override
protected void configure() {
    logger.info("configure {}", this.getClass().getSimpleName());
    final DataSender<SpanType> spanDataSender = newUdpSpanDataSender();
    logger.debug("spanDataSender:{}", spanDataSender);
    TypeLiteral<DataSender<SpanType>> spanDataSenderType = new TypeLiteral<DataSender<SpanType>>() {
    };
    Key<DataSender<SpanType>> spanDataSenderKey = Key.get(spanDataSenderType, SpanDataSender.class);
    bind(spanDataSenderKey).toInstance(spanDataSender);
    final DataSender<MetricType> statDataSender = newUdpStatDataSender();
    logger.debug("statDataSender:{}", statDataSender);
    TypeLiteral<DataSender<MetricType>> statDataSenderType = new TypeLiteral<DataSender<MetricType>>() {
    };
    Key<DataSender<MetricType>> statDataSenderKey = Key.get(statDataSenderType, StatDataSender.class);
    bind(statDataSenderKey).toInstance(statDataSender);
    bind(StorageFactory.class).to(TestSpanStorageFactory.class);
    bind(PinpointClientFactory.class).toProvider(Providers.of((PinpointClientFactory) null));
    EnhancedDataSender<MetaDataType> enhancedDataSender = newTcpDataSender();
    logger.debug("enhancedDataSender:{}", enhancedDataSender);
    TypeLiteral<EnhancedDataSender<MetaDataType>> dataSenderTypeLiteral = new TypeLiteral<EnhancedDataSender<MetaDataType>>() {
    };
    bind(dataSenderTypeLiteral).toInstance(enhancedDataSender);
    ServerMetaDataRegistryService serverMetaDataRegistryService = newServerMetaDataRegistryService();
    bind(ServerMetaDataRegistryService.class).toInstance(serverMetaDataRegistryService);
    bind(ApiMetaDataService.class).toProvider(MockApiMetaDataServiceProvider.class).in(Scopes.SINGLETON);
}
Also used : 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) MetricType(com.navercorp.pinpoint.profiler.monitor.metric.MetricType) EnhancedDataSender(com.navercorp.pinpoint.profiler.sender.EnhancedDataSender) SpanType(com.navercorp.pinpoint.profiler.context.SpanType) StorageFactory(com.navercorp.pinpoint.profiler.context.storage.StorageFactory) TypeLiteral(com.google.inject.TypeLiteral) PinpointClientFactory(com.navercorp.pinpoint.rpc.client.PinpointClientFactory) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) DefaultServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.DefaultServerMetaDataRegistryService) ServerMetaDataRegistryService(com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService)

Example 9 with MetaDataType

use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.

the class NioUdpDataSenderTest method newNioUdpDataSender.

private NioUDPDataSender<MetaDataType> newNioUdpDataSender() {
    TransactionIdEncoder encoder = new DefaultTransactionIdEncoder("agentId", 0);
    // SpanProcessor<TSpan, TSpanChunk> spanPostProcessor = new SpanProcessorV1();
    // MessageConverter<SpanType, TBase<?, ?>> messageConverter = new SpanThriftMessageConverter("appName", "agentId",
    // 0, ServiceType.STAND_ALONE.getCode(), encoder, spanPostProcessor);
    MessageConverter<MetaDataType, TBase<?, ?>> messageConverter = new MetadataMessageConverter("appName", "agentId", 0);
    return new NioUDPDataSender<>("localhost", PORT, "test", 128, 1000, 1024 * 64 * 100, messageConverter);
}
Also used : DefaultTransactionIdEncoder(com.navercorp.pinpoint.profiler.context.thrift.DefaultTransactionIdEncoder) MetadataMessageConverter(com.navercorp.pinpoint.profiler.context.thrift.MetadataMessageConverter) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) TransactionIdEncoder(com.navercorp.pinpoint.profiler.context.id.TransactionIdEncoder) DefaultTransactionIdEncoder(com.navercorp.pinpoint.profiler.context.thrift.DefaultTransactionIdEncoder) TBase(org.apache.thrift.TBase)

Example 10 with MetaDataType

use of com.navercorp.pinpoint.profiler.metadata.MetaDataType in project pinpoint by naver.

the class NioUdpDataSenderTest method sendMessage_getLimit.

private boolean sendMessage_getLimit(MetaDataType metaData, long waitTimeMillis) throws InterruptedException {
    final AtomicBoolean limitCounter = new AtomicBoolean(false);
    final CountDownLatch latch = new CountDownLatch(1);
    NioUDPDataSender<MetaDataType> sender = newNioUdpDataSender();
    try {
        sender.send(metaData);
        latch.await(waitTimeMillis, TimeUnit.MILLISECONDS);
    } finally {
        sender.stop();
    }
    return limitCounter.get();
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) MetaDataType(com.navercorp.pinpoint.profiler.metadata.MetaDataType) CountDownLatch(java.util.concurrent.CountDownLatch)

Aggregations

MetaDataType (com.navercorp.pinpoint.profiler.metadata.MetaDataType)19 PinpointClientFactory (com.navercorp.pinpoint.rpc.client.PinpointClientFactory)12 Test (org.junit.Test)10 DefaultPinpointClientFactory (com.navercorp.pinpoint.rpc.client.DefaultPinpointClientFactory)9 TestPinpointServerAcceptor (com.navercorp.pinpoint.test.server.TestPinpointServerAcceptor)8 ServerMetaDataRegistryService (com.navercorp.pinpoint.profiler.context.ServerMetaDataRegistryService)4 CountDownLatch (java.util.concurrent.CountDownLatch)3 TypeLiteral (com.google.inject.TypeLiteral)2 GeneratedMessageV3 (com.google.protobuf.GeneratedMessageV3)2 ChannelFactory (com.navercorp.pinpoint.grpc.client.ChannelFactory)2 ChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.ChannelFactoryBuilder)2 DefaultChannelFactoryBuilder (com.navercorp.pinpoint.grpc.client.DefaultChannelFactoryBuilder)2 SpanType (com.navercorp.pinpoint.profiler.context.SpanType)2 DefaultTransactionIdEncoder (com.navercorp.pinpoint.profiler.context.thrift.DefaultTransactionIdEncoder)2 StringMetaData (com.navercorp.pinpoint.profiler.metadata.StringMetaData)2 MetricType (com.navercorp.pinpoint.profiler.monitor.metric.MetricType)2 DataSender (com.navercorp.pinpoint.profiler.sender.DataSender)2 EnhancedDataSender (com.navercorp.pinpoint.profiler.sender.EnhancedDataSender)2 PinpointClient (com.navercorp.pinpoint.rpc.client.PinpointClient)2 PinpointClientReconnectEventListener (com.navercorp.pinpoint.rpc.client.PinpointClientReconnectEventListener)2