use of com.navercorp.pinpoint.profiler.AgentInfoSender in project pinpoint by naver.
the class AgentInfoSenderProvider method get.
@Override
public AgentInfoSender get() {
final EnhancedDataSender enhancedDataSender = this.enhancedDataSenderProvider.get();
final AgentInformation agentInformation = this.agentInformationProvider.get();
final AgentInfoSender.Builder builder = new AgentInfoSender.Builder(enhancedDataSender, agentInformation, jvmInformation);
builder.sendInterval(profilerConfig.getAgentInfoSendRetryInterval());
return builder.build();
}
use of com.navercorp.pinpoint.profiler.AgentInfoSender in project pinpoint by naver.
the class MockApplicationContextModuleTest method testMockApplicationContext.
@Test
public void testMockApplicationContext() {
ProfilerConfig profilerConfig = new DefaultProfilerConfig();
InterceptorRegistryBinder binder = new TestInterceptorRegistryBinder();
AgentOption agentOption = new DefaultAgentOption(new DummyInstrumentation(), "mockAgent", "mockApplicationName", profilerConfig, new URL[0], null, new DefaultServiceTypeRegistryService(), new DefaultAnnotationKeyRegistryService());
DefaultApplicationContext applicationContext = new DefaultApplicationContext(agentOption, binder) {
@Override
protected Module newApplicationContextModule(AgentOption agentOption, InterceptorRegistryBinder interceptorRegistryBinder) {
Module module = super.newApplicationContextModule(agentOption, interceptorRegistryBinder);
PluginApplicationContextModule pluginApplicationContextModule = new PluginApplicationContextModule();
return Modules.override(module).with(pluginApplicationContextModule);
}
};
Injector injector = applicationContext.getInjector();
// singleton check
AgentInfoSender instance1 = injector.getInstance(AgentInfoSender.class);
AgentInfoSender instance2 = injector.getInstance(AgentInfoSender.class);
Assert.assertSame(instance1, instance2);
ClassFileTransformerDispatcher instance4 = injector.getInstance(ClassFileTransformerDispatcher.class);
}
use of com.navercorp.pinpoint.profiler.AgentInfoSender in project pinpoint by naver.
the class ServerMetaDataHolderProvider method get.
@Override
public ServerMetaDataHolder get() {
AgentInfoSender agentInfoSender = this.agentInfoSender.get();
List<String> vmArgs = RuntimeMXBeanUtils.getVmArgs();
ServerMetaDataHolder serverMetaDataHolder = new DefaultServerMetaDataHolder(vmArgs);
serverMetaDataHolder.addListener(agentInfoSender);
return serverMetaDataHolder;
}
use of com.navercorp.pinpoint.profiler.AgentInfoSender in project pinpoint by naver.
the class DefaultApplicationContextTest method test.
@Test
public void test() {
DefaultApplicationContext applicationContext = newApplicationContext();
try {
Injector injector = applicationContext.getInjector();
AgentInfoSender instance1 = injector.getInstance(AgentInfoSender.class);
AgentInfoSender instance2 = injector.getInstance(AgentInfoSender.class);
Assert.assertSame(instance1, instance2);
} finally {
applicationContext.close();
}
}
Aggregations