Search in sources :

Example 1 with EchoService

use of com.navercorp.pinpoint.profiler.receiver.service.EchoService in project pinpoint by naver.

the class ProfilerCommandServiceLocatorTest method basicFunctionTest1.

@Test
public void basicFunctionTest1() {
    ProfilerCommandLocatorBuilder builder = new ProfilerCommandLocatorBuilder();
    builder.addService(new EchoService());
    builder.addService(new EchoService());
    DefaultProfilerCommandServiceLocator commandServiceLocator = (DefaultProfilerCommandServiceLocator) builder.build();
    short commandEcho = TCommandType.ECHO.getCode();
    Assert.assertEquals(1, commandServiceLocator.getCommandServiceSize());
    Assert.assertEquals(1, commandServiceLocator.getCommandServiceCodes().size());
    Assert.assertTrue(commandServiceLocator.getCommandServiceCodes().contains(commandEcho));
    Assert.assertNotNull(commandServiceLocator.getService(commandEcho));
    Assert.assertNotNull(commandServiceLocator.getRequestService(commandEcho));
    Assert.assertNull(commandServiceLocator.getSimpleService(commandEcho));
    Assert.assertNull(commandServiceLocator.getStreamService(commandEcho));
}
Also used : EchoService(com.navercorp.pinpoint.profiler.receiver.service.EchoService) Test(org.junit.Test)

Example 2 with EchoService

use of com.navercorp.pinpoint.profiler.receiver.service.EchoService in project pinpoint by naver.

the class CommandDispatcherProvider method get.

@Override
public CommandDispatcher get() {
    ProfilerCommandLocatorBuilder builder = new ProfilerCommandLocatorBuilder();
    builder.addService(new EchoService());
    if (activeTraceRepository != null) {
        ActiveThreadService activeThreadService = new ActiveThreadService(thriftTransportConfig, activeTraceRepository);
        builder.addService(activeThreadService);
    }
    ProfilerCommandServiceLocator commandServiceLocator = builder.build();
    CommandDispatcher commandDispatcher = new CommandDispatcher(commandServiceLocator);
    return commandDispatcher;
}
Also used : ProfilerCommandLocatorBuilder(com.navercorp.pinpoint.profiler.receiver.ProfilerCommandLocatorBuilder) ActiveThreadService(com.navercorp.pinpoint.profiler.receiver.service.ActiveThreadService) EchoService(com.navercorp.pinpoint.profiler.receiver.service.EchoService) CommandDispatcher(com.navercorp.pinpoint.profiler.receiver.CommandDispatcher) ProfilerCommandServiceLocator(com.navercorp.pinpoint.profiler.receiver.ProfilerCommandServiceLocator)

Aggregations

EchoService (com.navercorp.pinpoint.profiler.receiver.service.EchoService)2 CommandDispatcher (com.navercorp.pinpoint.profiler.receiver.CommandDispatcher)1 ProfilerCommandLocatorBuilder (com.navercorp.pinpoint.profiler.receiver.ProfilerCommandLocatorBuilder)1 ProfilerCommandServiceLocator (com.navercorp.pinpoint.profiler.receiver.ProfilerCommandServiceLocator)1 ActiveThreadService (com.navercorp.pinpoint.profiler.receiver.service.ActiveThreadService)1 Test (org.junit.Test)1