Search in sources :

Example 1 with MetadataService

use of com.navercorp.pinpoint.collector.receiver.grpc.service.MetadataService in project pinpoint by naver.

the class AgentServerTestMain method run.

public void run() throws Exception {
    GrpcReceiver grpcReceiver = new GrpcReceiver();
    grpcReceiver.setEnable(true);
    grpcReceiver.setBeanName("AgentServer");
    BindAddress.Builder builder = BindAddress.newBuilder();
    builder.setPort(PORT);
    builder.setIp(IP);
    grpcReceiver.setBindAddress(builder.build());
    PingEventHandler pingEventHandler = mock(PingEventHandler.class);
    BindableService agentService = new AgentService(new MockDispatchHandler(), pingEventHandler, Executors.newFixedThreadPool(8), serverRequestFactory);
    grpcReceiver.setBindableServiceList(Arrays.asList(agentService, new MetadataService(new MockDispatchHandler(), Executors.newFixedThreadPool(8), serverRequestFactory)));
    grpcReceiver.setAddressFilter(new MockAddressFilter());
    grpcReceiver.setExecutor(Executors.newFixedThreadPool(8));
    grpcReceiver.setServerOption(ServerOption.newBuilder().build());
    grpcReceiver.afterPropertiesSet();
    grpcReceiver.blockUntilShutdown();
    grpcReceiver.destroy();
}
Also used : PingEventHandler(com.navercorp.pinpoint.grpc.server.lifecycle.PingEventHandler) AgentService(com.navercorp.pinpoint.collector.receiver.grpc.service.AgentService) BindAddress(com.navercorp.pinpoint.collector.receiver.BindAddress) MetadataService(com.navercorp.pinpoint.collector.receiver.grpc.service.MetadataService) BindableService(io.grpc.BindableService)

Aggregations

BindAddress (com.navercorp.pinpoint.collector.receiver.BindAddress)1 AgentService (com.navercorp.pinpoint.collector.receiver.grpc.service.AgentService)1 MetadataService (com.navercorp.pinpoint.collector.receiver.grpc.service.MetadataService)1 PingEventHandler (com.navercorp.pinpoint.grpc.server.lifecycle.PingEventHandler)1 BindableService (io.grpc.BindableService)1