use of com.navercorp.pinpoint.profiler.instrument.ASMEngine in project pinpoint by naver.
the class InstrumentEngineProvider method get.
public InstrumentEngine get() {
final String instrumentEngine = instrumentConfig.getProfileInstrumentEngine().toUpperCase();
if (InstrumentConfig.INSTRUMENT_ENGINE_ASM.equals(instrumentEngine)) {
logger.info("ASM InstrumentEngine");
// WARNING must be singleton
final InterceptorDefinitionFactory interceptorDefinitionFactory = new InterceptorDefinitionFactory();
// WARNING must be singleton
final ScopeFactory scopeFactory = new ScopeFactory();
EngineComponent engineComponent = new DefaultEngineComponent(objectBinderFactory, interceptorRegistryBinder, interceptorDefinitionFactory, apiMetaDataServiceProvider, scopeFactory);
return new ASMEngine(instrumentation, engineComponent);
} else {
logger.warn("Unknown InstrumentEngine:{}", instrumentEngine);
throw new IllegalArgumentException("Unknown InstrumentEngine:" + instrumentEngine);
}
}
use of com.navercorp.pinpoint.profiler.instrument.ASMEngine in project pinpoint by naver.
the class TestClassLoader method newTranslator.
private Translator newTranslator() {
final InstrumentEngine instrumentEngine = applicationContext.getInstrumentEngine();
if (instrumentEngine instanceof ASMEngine) {
logger.info("ASM BCI engine");
return new DefaultTranslator(this, applicationContext.getClassFileTransformer());
}
logger.info("Unknown BCI engine");
return new DefaultTranslator(this, applicationContext.getClassFileTransformer());
}
use of com.navercorp.pinpoint.profiler.instrument.ASMEngine in project pinpoint by naver.
the class TestClassLoader method addTranslator.
public void addTranslator() {
final InstrumentEngine instrumentEngine = applicationContext.getInstrumentEngine();
if (instrumentEngine instanceof JavassistEngine) {
logger.info("JAVASSIST BCI engine");
ClassPool classPool = ((JavassistEngine) instrumentEngine).getClassPool(this);
this.instrumentTranslator = new JavassistTranslator(this, classPool, applicationContext.getClassFileTransformerDispatcher());
this.addTranslator(instrumentTranslator);
} else if (instrumentEngine instanceof ASMEngine) {
logger.info("ASM BCI engine");
this.instrumentTranslator = new DefaultTranslator(this, applicationContext.getClassFileTransformerDispatcher());
this.addTranslator(instrumentTranslator);
} else {
logger.info("Unknown BCI engine");
this.instrumentTranslator = new DefaultTranslator(this, applicationContext.getClassFileTransformerDispatcher());
this.addTranslator(instrumentTranslator);
}
}
Aggregations