mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-27 13:46:45 +10:00
[강운덕] [LUCYSUS-1744] Span 데이터 구조를 api 호출 방식으로 변경하기 위해서 start end time위주로 변경함.
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@874 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
+1
-2
@@ -2,7 +2,6 @@ package com.profiler.modifier.arcus.interceptors;
|
||||
|
||||
import com.profiler.context.Annotation;
|
||||
import com.profiler.context.AsyncTrace;
|
||||
import com.profiler.context.TraceContext;
|
||||
import com.profiler.interceptor.StaticBeforeInterceptor;
|
||||
import com.profiler.util.InterceptorUtils;
|
||||
import com.profiler.util.MetaObject;
|
||||
@@ -65,7 +64,7 @@ public class BaseOperationTransitionStateInterceptor implements StaticBeforeInte
|
||||
TimeObject timeObject = (TimeObject) asyncTrace.getAttachObject();
|
||||
timeObject.markSendTime();
|
||||
|
||||
long createTime = asyncTrace.getSpan().getCreateTime();
|
||||
long createTime = asyncTrace.getSpan().getStartTime();
|
||||
asyncTrace.record(Annotation.ClientSend, System.currentTimeMillis() - createTime);
|
||||
} else if (newState == OperationState.COMPLETE || newState == OperationState.TIMEDOUT) {
|
||||
if (logger.isLoggable(Level.FINE)) {
|
||||
|
||||
@@ -12,8 +12,9 @@ import java.util.logging.Logger;
|
||||
public class ConnectionCloseInterceptor implements StaticBeforeInterceptor {
|
||||
|
||||
private final Logger logger = Logger.getLogger(ConnectionCloseInterceptor.class.getName());
|
||||
private static final Object[] EMPTY = new Object[]{null};
|
||||
|
||||
private final MetaObject setUrl = new MetaObject("__setUrl", String.class);
|
||||
private final MetaObject setUrl = new MetaObject("__setUrl", Object.class);
|
||||
|
||||
@Override
|
||||
public void before(Object target, String className, String methodName, String parameterDescription, Object[] args) {
|
||||
@@ -26,7 +27,7 @@ public class ConnectionCloseInterceptor implements StaticBeforeInterceptor {
|
||||
}
|
||||
// close의 경우 호출이 실패하더라도 데이터를 삭제해야함.
|
||||
if (target instanceof Connection) {
|
||||
this.setUrl.invoke(target, new Object[]{null});
|
||||
this.setUrl.invoke(target, EMPTY);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ public class PreparedStatementExecuteQueryInterceptor implements StaticAroundInt
|
||||
Map bindValue = getBindValue.invoke(target);
|
||||
String bindString = toBindVariable(bindValue);
|
||||
trace.recordAttribute("BindValue", bindString);
|
||||
trace.recordAttribute("API", descriptor.getClassName() + "." + descriptor.getMethodName() + descriptor.getSimpleParameterDescriptor());
|
||||
trace.recordAttribute("API", descriptor.getClassName() + "." + descriptor.getMethodName() + descriptor.getSimpleParameterDescriptor() + ":" + descriptor.getLineNumber());
|
||||
|
||||
clean(target);
|
||||
|
||||
|
||||
+7
-7
@@ -40,19 +40,19 @@ public class StandardHostValveInvokeInterceptor implements StaticAroundIntercept
|
||||
TraceID traceId = populateTraceIdFromRequest(request);
|
||||
Trace trace;
|
||||
if (traceId != null) {
|
||||
TraceID nextTraceId = traceId.getNextTraceId();
|
||||
trace = new Trace(traceId);
|
||||
if (logger.isLoggable(Level.INFO)) {
|
||||
logger.info("TraceID exist. continue trace. " + nextTraceId);
|
||||
logger.info("TraceID exist. continue trace. " + trace.getCurrentTraceId());
|
||||
logger.log(Level.FINE, "requestUrl:" + requestURL + " clientIp" + clientIP + " parameter:" + parameters);
|
||||
}
|
||||
trace = traceContext.attachTraceObject(nextTraceId);
|
||||
traceContext.attachTraceObject(trace);
|
||||
} else {
|
||||
TraceID newTraceID = TraceID.newTraceId();
|
||||
trace = new Trace();
|
||||
if (logger.isLoggable(Level.INFO)) {
|
||||
logger.info("TraceID not exist. start new trace. " + newTraceID);
|
||||
logger.info("TraceID not exist. start new trace. " + trace.getCurrentTraceId());
|
||||
logger.log(Level.FINE, "requestUrl:" + requestURL + " clientIp" + clientIP + " parameter:" + parameters);
|
||||
}
|
||||
trace = traceContext.attachTraceObject(newTraceID);
|
||||
traceContext.attachTraceObject(trace);
|
||||
}
|
||||
|
||||
trace.markBeforeTime();
|
||||
@@ -90,7 +90,7 @@ public class StandardHostValveInvokeInterceptor implements StaticAroundIntercept
|
||||
}
|
||||
// TODO result 가 Exception 타입일경우 호출 실패임.
|
||||
trace.record(Annotation.ServerSend, trace.afterTime());
|
||||
|
||||
trace.traceBlockEnd();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user