Search in sources :

Example 11 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class CommonsDbcp2ConfigTest method createCommonsDbcpConfig.

private CommonsDbcp2Config createCommonsDbcpConfig(String pluginEnable, String profileConnectionCloseEnable) {
    Properties properties = new Properties();
    properties.put(CommonsDbcp2Config.DBCP2_PLUGIN_ENABLE, pluginEnable);
    properties.put(CommonsDbcp2Config.DBCP2_PROFILE_CONNECTIONCLOSE_ENABLE, profileConnectionCloseEnable);
    ProfilerConfig profilerConfig = new DefaultProfilerConfig(properties);
    return new CommonsDbcp2Config(profilerConfig);
}
Also used : ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) Properties(java.util.Properties)

Example 12 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class HikariCpConfigTest method createHikariCpConfig.

private HikariCpConfig createHikariCpConfig(String pluginEnable, String profileConnectionCloseEnable) {
    Properties properties = new Properties();
    properties.put(HikariCpConfig.HIKARICP_PLUGIN_ENABLE, pluginEnable);
    properties.put(HikariCpConfig.HIKARICP_PROFILE_CONNECTIONCLOSE_ENABLE, profileConnectionCloseEnable);
    ProfilerConfig profilerConfig = new DefaultProfilerConfig(properties);
    return new HikariCpConfig(profilerConfig);
}
Also used : ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) Properties(java.util.Properties)

Example 13 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class DefaultApplicationContextTest method newApplicationContext.

private DefaultApplicationContext newApplicationContext() {
    ProfilerConfig profilerConfig = new DefaultProfilerConfig();
    InterceptorRegistryBinder binder = new TestInterceptorRegistryBinder();
    Instrumentation instrumentation = mock(Instrumentation.class);
    AgentOption agentOption = new DefaultAgentOption(instrumentation, "mockAgent", "mockApplicationName", profilerConfig, new URL[0], null, new DefaultServiceTypeRegistryService(), new DefaultAnnotationKeyRegistryService());
    return new DefaultApplicationContext(agentOption, binder);
}
Also used : TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) InterceptorRegistryBinder(com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultServiceTypeRegistryService(com.navercorp.pinpoint.common.service.DefaultServiceTypeRegistryService) TestInterceptorRegistryBinder(com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder) Instrumentation(java.lang.instrument.Instrumentation) DefaultAgentOption(com.navercorp.pinpoint.bootstrap.DefaultAgentOption) AgentOption(com.navercorp.pinpoint.bootstrap.AgentOption) DefaultAnnotationKeyRegistryService(com.navercorp.pinpoint.common.service.DefaultAnnotationKeyRegistryService)

Example 14 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class DefaultTraceContextTest method disableTrace.

@Test
public void disableTrace() {
    ProfilerConfig profilerConfig = new DefaultProfilerConfig();
    TraceContext traceContext = MockTraceContextFactory.newTestTraceContext(profilerConfig);
    Trace trace = traceContext.disableSampling();
    Assert.assertNotNull(trace);
    Assert.assertFalse(trace.canSampled());
    traceContext.removeTraceObject();
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) TraceContext(com.navercorp.pinpoint.bootstrap.context.TraceContext) Test(org.junit.Test)

Example 15 with DefaultProfilerConfig

use of com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig in project pinpoint by naver.

the class DefaultTraceContextTest method threadLocalBindTest.

@Test
public void threadLocalBindTest() {
    ProfilerConfig profilerConfig = new DefaultProfilerConfig();
    TraceContext traceContext = MockTraceContextFactory.newTestTraceContext(profilerConfig);
    Assert.assertNotNull(traceContext.newTraceObject());
    TraceContext traceContext2 = MockTraceContextFactory.newTestTraceContext(profilerConfig);
    Trace notExist = traceContext2.currentRawTraceObject();
    Assert.assertNull(notExist);
    Assert.assertNotNull(traceContext.currentRawTraceObject());
    traceContext.removeTraceObject();
    Assert.assertNull(traceContext.currentRawTraceObject());
}
Also used : Trace(com.navercorp.pinpoint.bootstrap.context.Trace) ProfilerConfig(com.navercorp.pinpoint.bootstrap.config.ProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) DefaultProfilerConfig(com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig) TraceContext(com.navercorp.pinpoint.bootstrap.context.TraceContext) Test(org.junit.Test)

Aggregations

DefaultProfilerConfig (com.navercorp.pinpoint.bootstrap.config.DefaultProfilerConfig)36 ProfilerConfig (com.navercorp.pinpoint.bootstrap.config.ProfilerConfig)33 Test (org.junit.Test)25 Properties (java.util.Properties)24 BeanDefinition (org.springframework.beans.factory.config.BeanDefinition)12 RootBeanDefinition (org.springframework.beans.factory.support.RootBeanDefinition)12 DefaultAnnotationKeyRegistryService (com.navercorp.pinpoint.common.service.DefaultAnnotationKeyRegistryService)5 DefaultServiceTypeRegistryService (com.navercorp.pinpoint.common.service.DefaultServiceTypeRegistryService)5 AgentOption (com.navercorp.pinpoint.bootstrap.AgentOption)4 DefaultAgentOption (com.navercorp.pinpoint.bootstrap.DefaultAgentOption)4 TraceContext (com.navercorp.pinpoint.bootstrap.context.TraceContext)4 InterceptorRegistryBinder (com.navercorp.pinpoint.profiler.interceptor.registry.InterceptorRegistryBinder)4 DefaultApplicationContext (com.navercorp.pinpoint.profiler.context.module.DefaultApplicationContext)3 Module (com.google.inject.Module)2 Trace (com.navercorp.pinpoint.bootstrap.context.Trace)2 Slf4jLoggerBinder (com.navercorp.pinpoint.profiler.logging.Slf4jLoggerBinder)2 TestInterceptorRegistryBinder (com.navercorp.pinpoint.profiler.util.TestInterceptorRegistryBinder)2 MockApplicationContext (com.navercorp.pinpoint.test.MockApplicationContext)2 TestClassLoader (com.navercorp.pinpoint.test.classloader.TestClassLoader)2 Instrumentation (java.lang.instrument.Instrumentation)2