[강운덕] [LUCYSUS-1744] hippo-profiler 패키지 명을 pinpoint로 변경. test만 이동.

- version을 0.0.2에서 0.0.3-SNAPSHOT으로 변경.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1732 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2013-05-31 10:30:35 +00:00
parent cc19e06b40
commit 5e2c014d4e
49 changed files with 104 additions and 82 deletions
@@ -1,4 +1,4 @@
package com.profiler;
package com.nhn.pinpoint;
import com.profiler.bootstrap.AgentClassLoader;
@@ -1,5 +1,6 @@
package com.profiler;
package com.nhn.pinpoint;
import com.profiler.DefaultAgent;
import com.profiler.config.ProfilerConfig;
import org.junit.Test;
import org.slf4j.Logger;
@@ -1,4 +1,4 @@
package com.profiler;
package com.nhn.pinpoint;
import java.lang.instrument.ClassDefinition;
import java.lang.instrument.ClassFileTransformer;
@@ -1,5 +1,6 @@
package com.profiler;
package com.nhn.pinpoint;
import com.profiler.SystemMonitor;
import com.profiler.config.ProfilerConfig;
import com.profiler.context.DefaultTraceContext;
import com.profiler.context.TraceContext;
@@ -1,5 +1,7 @@
package com.profiler.context;
package com.nhn.pinpoint.context;
import com.profiler.context.CallStack;
import com.profiler.context.DefaultTraceID;
import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,5 +1,7 @@
package com.profiler.context;
package com.nhn.pinpoint.context;
import com.profiler.context.BypassStorage;
import com.profiler.context.DefaultTrace;
import com.profiler.logging.Slf4jLoggerBinderInitializer;
import com.profiler.sender.LoggingDataSender;
import org.junit.*;
@@ -1,4 +1,4 @@
package com.profiler.context;
package com.nhn.pinpoint.context;
import org.junit.Test;
@@ -1,5 +1,7 @@
package com.profiler.context;
package com.nhn.pinpoint.context;
import com.profiler.context.BypassStorageFactory;
import com.profiler.context.DefaultTraceContext;
import com.profiler.sender.LoggingDataSender;
/**
@@ -1,4 +1,4 @@
package com.profiler.context;
package com.nhn.pinpoint.context;
import org.junit.Ignore;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.profiler.context;
package com.nhn.pinpoint.context;
import org.junit.Test;
@@ -1,7 +1,11 @@
package com.profiler.context;
package com.nhn.pinpoint.context;
import com.nhn.pinpoint.common.AnnotationKey;
import com.nhn.pinpoint.common.ServiceType;
import com.profiler.context.BypassStorage;
import com.profiler.context.DefaultTrace;
import com.profiler.context.DefaultTraceID;
import com.profiler.context.Thriftable;
import com.profiler.sender.DataSender;
import com.profiler.sender.LoggingDataSender;
@@ -1,4 +1,4 @@
package com.profiler.dto;
package com.nhn.pinpoint.dto;
import com.nhn.pinpoint.common.dto2.Header;
import org.junit.Test;
@@ -1,6 +1,6 @@
package com.profiler.interceptor;
package com.nhn.pinpoint.interceptor;
import com.profiler.interceptor.bci.TestObject;
import com.nhn.pinpoint.interceptor.bci.TestObject;
import javassist.*;
import org.junit.Assert;
import org.junit.Test;
@@ -67,7 +67,7 @@ public class InterceptorRegistryTest {
CtClass ctClass = p.get("com.profiler.interceptor.bci.TestObject");
CtClass ctClass = p.get("com.nhn.pinpoint.interceptor.bci.TestObject");
System.out.println(ctClass);
final CtMethod hello = ctClass.getMethod("hello", "(Ljava/lang/String;)Ljava/lang/String;");
System.out.println("langname:" + hello.getLongName());
@@ -83,15 +83,15 @@ public class InterceptorRegistryTest {
hello.addLocalVariable("result", object);
hello.insertBefore("{" +
"ctx = new com.profiler.interceptor.InterceptorContext();" +
"ctx = new com.nhn.pinpoint.interceptor.InterceptorContext();" +
"ctx.setParameter($args);" +
// InterceptorRegistry.class.getName() + ".getInterceptor(\"a\").before(ctx);" +
"interceptor = (com.profiler.interceptor.AroundInterceptor) " + InterceptorRegistry.class.getName() + ".getInterceptor(1);"+
"interceptor = (com.nhn.pinpoint.interceptor.AroundInterceptor) " + InterceptorRegistry.class.getName() + ".getInterceptor(1);"+
"interceptor.before(ctx);" +
"}");
hello.addCatch("{" +
// " interceptor.after(ctx);"+
// " com.profiler.interceptor.AroundInterceptor a = (com.profiler.interceptor.AroundInterceptor) " + InterceptorRegistry.class.getName() + ".getInterceptor(\"a\");"+
// " com.nhn.pinpoint.interceptor.AroundInterceptor a = (com.nhn.pinpoint.interceptor.AroundInterceptor) " + InterceptorRegistry.class.getName() + ".getInterceptor(\"a\");"+
" throw $e;" +
"}", throwable);
hello.insertAfter("{" +
@@ -101,7 +101,7 @@ public class InterceptorRegistryTest {
//
// hello.setBody(generatedAroundInterceptor("com.profiler.interceptor.bci.TestObject", "hello"));
// hello.setBody(generatedAroundInterceptor("com.nhn.pinpoint.interceptor.bci.TestObject", "hello"));
// hello.setBody("{ System.out.println(\"ddd\"); }", ClassMap map );
hello.insertBefore(" System.out.println(\" before + \");");
hello.insertAfter(" System.out.println($_);");
@@ -119,7 +119,7 @@ public class InterceptorRegistryTest {
// } catch (NotFoundException e) {
// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
// }
// String code = generatedAroundInterceptor("com.profiler.interceptor.bci.TestObject", "hello");
// String code = generatedAroundInterceptor("com.nhn.pinpoint.interceptor.bci.TestObject", "hello");
// m.replace(code);
// }
@@ -156,7 +156,7 @@ public class InterceptorRegistryTest {
private String generatedAroundInterceptor(String className, String methodName) {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append(" ctx = new com.profiler.interceptor.InterceptorContext();");
sb.append(" ctx = new com.nhn.pinpoint.interceptor.InterceptorContext();");
sb.append(" ctx.setParameter($args);");
sb.append(" ctx.setTarget(this);");
sb.append(" ");
@@ -170,7 +170,7 @@ public class InterceptorRegistryTest {
sb.append("}");
sb.append("{");
sb.append(" interceptor = (com.profiler.interceptor.AroundInterceptor) " + InterceptorRegistry.class.getName() + ".getInterceptor(\"a\");");
sb.append(" interceptor = (com.nhn.pinpoint.interceptor.AroundInterceptor) " + InterceptorRegistry.class.getName() + ".getInterceptor(\"a\");");
sb.append(" interceptor.before(ctx);");
sb.append(" result = null;");
// println(sb, "before systemout \"ttt\"");
@@ -1,4 +1,4 @@
package com.profiler.interceptor;
package com.nhn.pinpoint.interceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,4 +1,4 @@
package com.profiler.interceptor;
package com.nhn.pinpoint.interceptor;
public class TestAroundInterceptor implements StaticAroundInterceptor {
@@ -1,4 +1,4 @@
package com.profiler.interceptor;
package com.nhn.pinpoint.interceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,5 +1,6 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import com.profiler.interceptor.bci.CodeBuilder;
import org.junit.Assert;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import org.junit.Test;
@@ -1,7 +1,10 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import com.profiler.interceptor.TestAfterInterceptor;
import com.profiler.interceptor.TestBeforeInterceptor;
import com.nhn.pinpoint.interceptor.TestAfterInterceptor;
import com.nhn.pinpoint.interceptor.TestBeforeInterceptor;
import com.profiler.interceptor.bci.ByteCodeInstrumentor;
import com.profiler.interceptor.bci.InstrumentClass;
import com.profiler.interceptor.bci.JavaAssistByteCodeInstrumentor;
import javassist.bytecode.Descriptor;
import org.junit.Assert;
import org.junit.Test;
@@ -19,7 +22,7 @@ public class JavaAssistClassTest {
public void testBeforeAddInterceptor() throws Exception {
ByteCodeInstrumentor javaAssistByteCodeInstrumentor = new JavaAssistByteCodeInstrumentor();
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.profiler.interceptor.bci.TestObject");
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.nhn.pinpoint.interceptor.bci.TestObject");
TestBeforeInterceptor interceptor = new TestBeforeInterceptor();
String methodName = "callA";
@@ -31,7 +34,7 @@ public class JavaAssistClassTest {
callA.invoke(testObject);
Assert.assertEquals(interceptor.call, 1);
Assert.assertEquals(interceptor.className, "com.profiler.interceptor.bci.TestObject");
Assert.assertEquals(interceptor.className, "com.nhn.pinpoint.interceptor.bci.TestObject");
Assert.assertEquals(interceptor.methodName, methodName);
Assert.assertEquals(interceptor.args, null);
Assert.assertEquals(interceptor.target, testObject);
@@ -42,7 +45,7 @@ public class JavaAssistClassTest {
public void testBeforeAddInterceptorFormContextClassLoader() throws Exception {
ByteCodeInstrumentor javaAssistByteCodeInstrumentor = new JavaAssistByteCodeInstrumentor();
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.profiler.interceptor.bci.TestObjectContextClassLoader");
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.nhn.pinpoint.interceptor.bci.TestObjectContextClassLoader");
TestBeforeInterceptor interceptor = new TestBeforeInterceptor();
String methodName = "callA";
@@ -54,7 +57,7 @@ public class JavaAssistClassTest {
callA.invoke(testObject);
Assert.assertEquals(interceptor.call, 1);
Assert.assertEquals(interceptor.className, "com.profiler.interceptor.bci.TestObjectContextClassLoader");
Assert.assertEquals(interceptor.className, "com.nhn.pinpoint.interceptor.bci.TestObjectContextClassLoader");
Assert.assertEquals(interceptor.methodName, methodName);
Assert.assertEquals(interceptor.args, null);
Assert.assertEquals(interceptor.target, testObject);
@@ -66,7 +69,7 @@ public class JavaAssistClassTest {
// TODO aClass.addInterceptorCallByContextClassLoader 코드의 테스트 케이스도 추가해야함.
ByteCodeInstrumentor javaAssistByteCodeInstrumentor = new JavaAssistByteCodeInstrumentor();
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.profiler.interceptor.bci.TestObject2");
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.nhn.pinpoint.interceptor.bci.TestObject2");
TestAfterInterceptor callaInterceptor = new TestAfterInterceptor();
String callA = "callA";
@@ -83,7 +86,7 @@ public class JavaAssistClassTest {
Object result = callAMethod.invoke(testObject);
Assert.assertEquals(callaInterceptor.call, 1);
Assert.assertEquals(callaInterceptor.className, "com.profiler.interceptor.bci.TestObject2");
Assert.assertEquals(callaInterceptor.className, "com.nhn.pinpoint.interceptor.bci.TestObject2");
Assert.assertEquals(callaInterceptor.methodName, callA);
Assert.assertNull(callaInterceptor.args);
Assert.assertEquals(callaInterceptor.target, testObject);
@@ -93,7 +96,7 @@ public class JavaAssistClassTest {
callBMethod.invoke(testObject);
Assert.assertEquals(callbInterceptor.call, 1);
Assert.assertEquals(callbInterceptor.className, "com.profiler.interceptor.bci.TestObject2");
Assert.assertEquals(callbInterceptor.className, "com.nhn.pinpoint.interceptor.bci.TestObject2");
Assert.assertEquals(callbInterceptor.methodName, callB);
Assert.assertNull(callbInterceptor.args);
Assert.assertEquals(callbInterceptor.target, testObject);
@@ -110,7 +113,7 @@ public class JavaAssistClassTest {
@Test
public void testLog() throws Exception {
ByteCodeInstrumentor javaAssistByteCodeInstrumentor = new JavaAssistByteCodeInstrumentor();
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.profiler.interceptor.bci.TestLog");
InstrumentClass aClass = javaAssistByteCodeInstrumentor.getClass("com.nhn.pinpoint.interceptor.bci.TestLog");
aClass.addDebugLogBeforeAfterMethod();
aClass.addDebugLogBeforeAfterConstructor();
@@ -1,4 +1,4 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import javassist.*;
import org.junit.Test;
@@ -13,7 +13,7 @@ public class MethodRenameInterceptorTest {
// Method rename을 사용해서 local 변수를 공유하는 방법의 경우 call stack이 변경되는 문제점이있다.
try {
String methodName = "callA";
String objectName = "com.profiler.interceptor.bci.TestObject";
String objectName = "com.nhn.pinpoint.interceptor.bci.TestObject";
// start by getting the class file and method
CtClass clas = ClassPool.getDefault().get(objectName);
if (clas == null) {
@@ -1,4 +1,4 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import javassist.*;
import org.junit.Before;
@@ -1,4 +1,4 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import org.slf4j.Logger;
@@ -1,4 +1,4 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,4 +1,4 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,4 +1,4 @@
package com.profiler.interceptor.bci;
package com.nhn.pinpoint.interceptor.bci;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -1,4 +1,4 @@
package com.profiler.javaassist;
package com.nhn.pinpoint.javaassist;
import javassist.ClassPool;
import javassist.CtClass;
@@ -67,7 +67,7 @@ public class JavaAssiastTest {
@Test
public void innerClass() throws NotFoundException {
CtClass testClass = pool.get("com.profiler.javaassist.TestClass");
CtClass testClass = pool.get("com.nhn.pinpoint.javaassist.TestClass");
System.out.println(testClass);
CtClass[] nestedClasses = testClass.getNestedClasses();
for(CtClass nested : nestedClasses) {
@@ -75,10 +75,10 @@ public class JavaAssiastTest {
}
CtClass innerClass = pool.get("com.profiler.javaassist.TestClass$InnerClass");
CtClass innerClass = pool.get("com.nhn.pinpoint.javaassist.TestClass$InnerClass");
System.out.println(innerClass);
CtClass class1 = pool.get("com.profiler.javaassist.TestClass$1");
CtClass class1 = pool.get("com.nhn.pinpoint.javaassist.TestClass$1");
System.out.println(class1);
}
}
@@ -1,4 +1,4 @@
package com.profiler.javaassist;
package com.nhn.pinpoint.javaassist;
import javassist.CannotCompileException;
import javassist.ClassPool;
@@ -83,7 +83,7 @@ public class TestBootstrapClass {
@Test
public void testReflection() throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
java.lang.ClassLoader contextClassLoader = java.lang.Thread.currentThread().getContextClassLoader();
java.lang.Class<?> interceptorRegistry = contextClassLoader.loadClass("com.profiler.interceptor.InterceptorRegistry");
java.lang.Class<?> interceptorRegistry = contextClassLoader.loadClass("com.nhn.pinpoint.interceptor.InterceptorRegistry");
java.lang.reflect.Method getInterceptorMethod = interceptorRegistry.getMethod("getInterceptor", new java.lang.Class[]{int.class});
java.lang.Object interceptor = getInterceptorMethod.invoke(interceptorRegistry, Integer.valueOf(1));
@@ -1,4 +1,4 @@
package com.profiler.javaassist;
package com.nhn.pinpoint.javaassist;
public class TestClass {
private int a;
@@ -1,4 +1,4 @@
package com.profiler.logger;
package com.nhn.pinpoint.logger;
import org.junit.Test;
@@ -1,5 +1,7 @@
package com.profiler.metadata;
package com.nhn.pinpoint.metadata;
import com.profiler.metadata.LRUCache;
import com.profiler.metadata.SqlObject;
import junit.framework.Assert;
import org.junit.Test;
@@ -1,5 +1,7 @@
package com.profiler.metadata;
package com.nhn.pinpoint.metadata;
import com.profiler.metadata.Result;
import com.profiler.metadata.StringCache;
import junit.framework.Assert;
import org.junit.Test;
@@ -1,15 +1,16 @@
package com.profiler.modifier.db.mysql;
package com.nhn.pinpoint.modifier.db.mysql;
import com.mysql.jdbc.JDBC4PreparedStatement;
import com.profiler.DefaultAgent;
import com.profiler.DummyInstrumentation;
import com.nhn.pinpoint.DummyInstrumentation;
import com.profiler.config.ProfilerConfig;
import com.profiler.logging.Slf4jLoggerBinder;
import com.profiler.modifier.db.DatabaseInfo;
import com.profiler.modifier.db.mysql.*;
import com.profiler.util.MetaObject;
import com.profiler.util.TestClassLoader;
import com.nhn.pinpoint.util.TestClassLoader;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.profiler.modifier.mapping;
package com.nhn.pinpoint.modifier.mapping;
import com.nhn.pinpoint.common.mapping.ApiUtils;
import junit.framework.Assert;
@@ -1,4 +1,4 @@
package com.profiler.modifier.tomcat;
package com.nhn.pinpoint.modifier.tomcat;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
@@ -9,7 +9,7 @@ import java.util.UUID;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.profiler.context.MockTraceContextFactory;
import com.nhn.pinpoint.context.MockTraceContextFactory;
import com.profiler.context.TraceContext;
import com.profiler.logging.Slf4jLoggerBinder;
import com.profiler.logging.LoggerFactory;
@@ -1,6 +1,7 @@
package com.profiler.sampler;
package com.nhn.pinpoint.sampler;
import com.profiler.sampler.SamplingRateSampler;
import org.junit.Assert;
import org.junit.Test;
@@ -1,13 +1,9 @@
package com.profiler.sender;
package com.nhn.pinpoint.sender;
import com.profiler.common.dto.thrift.AgentInfo;
import com.profiler.logging.LoggerBinder;
import com.profiler.logging.LoggerFactory;
import com.profiler.logging.Slf4jLoggerBinder;
import com.profiler.logging.Slf4jLoggerBinderInitializer;
import junit.framework.TestCase;
import com.profiler.sender.UdpDataSender;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.profiler.socket;
package com.nhn.pinpoint.sender;
import org.junit.After;
import org.junit.Assert;
@@ -1,5 +1,6 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import com.profiler.util.ArrayUtils;
import org.junit.Assert;
import org.junit.Test;
import org.slf4j.Logger;
@@ -1,4 +1,4 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import com.nhn.pinpoint.common.dto2.Header;
import com.nhn.pinpoint.common.dto2.thrift.JVMInfoThriftDTO;
@@ -1,4 +1,4 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import java.net.InetAddress;
@@ -1,4 +1,4 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import com.profiler.modifier.Modifier;
import javassist.*;
@@ -1,6 +1,7 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import com.nhn.pinpoint.common.mapping.ApiUtils;
import com.profiler.util.JavaAssistUtils;
import javassist.*;
import org.junit.Assert;
import org.junit.Before;
@@ -1,4 +1,4 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import org.junit.Test;
@@ -1,5 +1,6 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import com.profiler.util.PreparedStatementUtils;
import org.junit.Assert;
import org.junit.Test;
@@ -1,5 +1,6 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import com.profiler.util.QueryStringUtil;
import org.junit.Assert;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import junit.framework.Assert;
import org.junit.Test;
@@ -1,4 +1,4 @@
package com.profiler.util;
package com.nhn.pinpoint.util;
import com.profiler.Agent;
import com.profiler.DefaultAgent;
@@ -6,7 +6,6 @@ import com.profiler.context.DefaultTrace;
import com.profiler.context.DefaultTraceContext;
import com.profiler.context.Trace;
import com.profiler.context.TraceContext;
import com.profiler.interceptor.*;
import com.profiler.interceptor.bci.ByteCodeInstrumentor;
import com.profiler.interceptor.bci.JavaAssistByteCodeInstrumentor;
import com.profiler.logging.LoggingUtils;
@@ -1,4 +1,4 @@
package com.profiler.util.bindvalue;
package com.nhn.pinpoint.util.bindvalue;
import org.junit.Test;
@@ -1,5 +1,6 @@
package com.profiler.util.bindvalue;
package com.nhn.pinpoint.util.bindvalue;
import com.profiler.util.bindvalue.Types;
import org.junit.Assert;
import org.junit.Test;