use of com.navercorp.pinpoint.bootstrap.config.ProfilerConfig in project pinpoint by naver.
the class CommonsDbcpConfigTest method createCommonsDbcpConfig.
private CommonsDbcpConfig createCommonsDbcpConfig(String pluginEnable, String profileConnectionCloseEnable) {
Properties properties = new Properties();
properties.put(CommonsDbcpConfig.DBCP_PLUGIN_ENABLE, pluginEnable);
properties.put(CommonsDbcpConfig.DBCP_PROFILE_CONNECTIONCLOSE_ENABLE, profileConnectionCloseEnable);
ProfilerConfig profilerConfig = new DefaultProfilerConfig(properties);
return new CommonsDbcpConfig(profilerConfig);
}
use of com.navercorp.pinpoint.bootstrap.config.ProfilerConfig 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);
}
use of com.navercorp.pinpoint.bootstrap.config.ProfilerConfig 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);
}
use of com.navercorp.pinpoint.bootstrap.config.ProfilerConfig in project pinpoint by naver.
the class SpringBeansPlugin method addAbstractAutowireCapableBeanFactoryTransformer.
private void addAbstractAutowireCapableBeanFactoryTransformer(final ProfilerPluginSetupContext context) {
final ProfilerConfig config = context.getConfig();
final boolean errorMark = config.readBoolean(SPRING_BEANS_MARK_ERROR, false);
transformTemplate.transform("org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory", new TransformCallback() {
@Override
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {
InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);
final BeanMethodTransformer beanTransformer = new BeanMethodTransformer(errorMark);
final ObjectFactory beanFilterFactory = ObjectFactory.byStaticFactory("com.navercorp.pinpoint.plugin.spring.beans.interceptor.TargetBeanFilter", "of", config);
final InstrumentMethod createBeanInstance = target.getDeclaredMethod("createBeanInstance", "java.lang.String", "org.springframework.beans.factory.support.RootBeanDefinition", "java.lang.Object[]");
createBeanInstance.addInterceptor("com.navercorp.pinpoint.plugin.spring.beans.interceptor.CreateBeanInstanceInterceptor", va(beanTransformer, beanFilterFactory));
final InstrumentMethod postProcessor = target.getDeclaredMethod("applyBeanPostProcessorsBeforeInstantiation", "java.lang.Class", "java.lang.String");
postProcessor.addInterceptor("com.navercorp.pinpoint.plugin.spring.beans.interceptor.PostProcessorInterceptor", va(beanTransformer, beanFilterFactory));
return target.toBytecode();
}
});
}
use of com.navercorp.pinpoint.bootstrap.config.ProfilerConfig in project pinpoint by naver.
the class SpringBeansPlugin method addClassPathDefinitionScannerTransformer.
private void addClassPathDefinitionScannerTransformer(final ProfilerPluginSetupContext context) {
final ProfilerConfig config = context.getConfig();
final boolean errorMark = config.readBoolean(SPRING_BEANS_MARK_ERROR, false);
transformTemplate.transform("org.springframework.context.annotation.ClassPathBeanDefinitionScanner", new TransformCallback() {
@Override
public byte[] doInTransform(Instrumentor instrumentor, ClassLoader loader, String className, Class<?> classBeingRedefined, ProtectionDomain protectionDomain, byte[] classfileBuffer) throws InstrumentException {
InstrumentClass target = instrumentor.getInstrumentClass(loader, className, classfileBuffer);
final BeanMethodTransformer beanTransformer = new BeanMethodTransformer(errorMark);
final ObjectFactory beanFilterFactory = ObjectFactory.byStaticFactory("com.navercorp.pinpoint.plugin.spring.beans.interceptor.TargetBeanFilter", "of", context.getConfig());
final InstrumentMethod method = target.getDeclaredMethod("doScan", "java.lang.String[]");
method.addInterceptor("com.navercorp.pinpoint.plugin.spring.beans.interceptor.ClassPathDefinitionScannerDoScanInterceptor", va(loader, beanTransformer, beanFilterFactory));
return target.toBytecode();
}
});
}
Aggregations