[강운덕] [LUCYSUS-1744] endpoint를 정규화 하여 ip 데이터 위주로 치환하는것으로 수정함.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1344 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2013-03-18 08:23:24 +00:00
parent d73c263dd2
commit 46f5135d91
14 changed files with 39 additions and 19 deletions
+3 -1
View File
@@ -141,7 +141,9 @@ public class Agent implements Runnable {
private void changeStatus(AgentStatus status) {
this.agentStatus = status;
logger.severe("Agent status is changed. " + status);
if (logger.isLoggable(Level.FINE)) {
logger.fine("Agent status is changed. " + status);
}
}
private short getShortIdentifier() {
@@ -62,7 +62,7 @@ public class BaseOperationTransitionStateInterceptor implements StaticBeforeInte
SocketAddress socketAddress = handlingNode.getSocketAddress();
if (socketAddress instanceof InetSocketAddress) {
InetSocketAddress address = (InetSocketAddress) socketAddress;
asyncTrace.recordEndPoint("ARCUS:" + address.getHostName() + ":" + address.getPort());
asyncTrace.recordEndPoint(address.getHostName() + ":" + address.getPort());
}
String serviceCode = (String) getServiceCode.invoke(target);
@@ -64,7 +64,7 @@ public class Execute2MethodInterceptor implements StaticAroundInterceptor, ByteC
trace.recordServiceType(ServiceType.HTTP_CLIENT);
int port = host.getPort();
trace.recordEndPoint(host.getHostName() + ((port > 0) ? ":" + port : ""));
// trace.recordEndPoint(host.getHostName() + ((port > 0) ? ":" + port : ""));
trace.recordDestinationId(host.getHostName() + ((port > 0) ? ":" + port : ""));
trace.recordAttribute(AnnotationKey.HTTP_URL, request.getRequestLine().getUri());
}
@@ -65,7 +65,7 @@ public class ExecuteMethodInterceptor implements StaticAroundInterceptor, ByteCo
trace.recordServiceType(ServiceType.HTTP_CLIENT);
int port = host.getPort();
trace.recordEndPoint(host.getHostName() + ((port > 0) ? ":" + port : ""));
// trace.recordEndPoint(host.getHostName() + ((port > 0) ? ":" + port : ""));
trace.recordDestinationId(host.getHostName() + ((port > 0) ? ":" + port : ""));
trace.recordAttribute(AnnotationKey.HTTP_URL, request.getRequestLine().getUri());
@@ -57,7 +57,7 @@ public class ConnectMethodInterceptor implements StaticAroundInterceptor, ByteCo
int port = request.getURL().getPort();
// TODO protocol은 어떻게 표기하지???
trace.recordEndPoint(host + ((port > 0) ? ":" + port : ""));
// trace.recordEndPoint(host + ((port > 0) ? ":" + port : ""));
trace.recordDestinationId(host + ((port > 0) ? ":" + port : ""));
trace.recordAttribute(AnnotationKey.HTTP_URL, request.getURL().toString());
@@ -75,7 +75,7 @@ public class DriverConnectInterceptor implements StaticAroundInterceptor, ByteCo
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -49,7 +49,7 @@ public class PreparedStatementCreateInterceptor implements StaticAroundIntercept
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -53,7 +53,7 @@ public class PreparedStatementExecuteQueryInterceptor implements StaticAroundInt
trace.recordServiceType(databaseInfo.getExecuteQueryType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -50,7 +50,7 @@ public class StatementExecuteQueryInterceptor implements StaticAroundInterceptor
trace.recordServiceType(databaseInfo.getExecuteQueryType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -51,7 +51,7 @@ public class StatementExecuteUpdateInterceptor implements StaticAroundIntercepto
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -81,7 +81,7 @@ public class TransactionInterceptor implements StaticAroundInterceptor, ByteCode
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
}
@@ -109,7 +109,7 @@ public class TransactionInterceptor implements StaticAroundInterceptor, ByteCode
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -121,7 +121,7 @@ public class TransactionInterceptor implements StaticAroundInterceptor, ByteCode
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -147,7 +147,7 @@ public class TransactionInterceptor implements StaticAroundInterceptor, ByteCode
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
}
@@ -159,7 +159,7 @@ public class TransactionInterceptor implements StaticAroundInterceptor, ByteCode
trace.recordServiceType(databaseInfo.getType());
trace.recordEndPoint(databaseInfo.getUrl());
trace.recordEndPoint(databaseInfo.getMultipleHost());
trace.recordDestinationId(databaseInfo.getDatabaseId());
trace.recordDestinationAddress(databaseInfo.getHost());
@@ -16,6 +16,7 @@ public class DatabaseInfo {
private String realUrl;
private String normalizedUrl;
private List<String> host;
private String multipleHost;
public DatabaseInfo(ServiceType type, ServiceType executeQueryType, String realUrl, String normalizedUrl, List<String> host, String databaseId) {
this.type = type;
@@ -23,17 +24,35 @@ public class DatabaseInfo {
this.realUrl = realUrl;
this.normalizedUrl = normalizedUrl;
this.host = host;
this.multipleHost = merge(host);
this.databaseId = databaseId;
}
private String merge(List<java.lang.String> host) {
if (host.size() == 0) {
return "";
}
String single = host.get(0);
StringBuilder sb = new StringBuilder();
sb.append(single);
for(int i =1; i<host.size(); i++) {
sb.append(',');
sb.append(host.get(i));
}
return sb.toString();
}
public List<String> getHost() {
public List<String> getHost() {
// host와 port의 경우 replication 설정등으로 n개가 될수 있어 애매하다.
return host;
}
public String getMultipleHost() {
return multipleHost;
}
public String getDatabaseId() {
public String getDatabaseId() {
return databaseId;
}
@@ -46,9 +46,7 @@ public class StandardHostValveInvokeInterceptor implements StaticAroundIntercept
TraceID traceId = populateTraceIdFromRequest(request);
Trace trace;
if (traceId != null) {
// TraceID nextTraceId = traceId.getNextTraceId();
if (logger.isLoggable(Level.INFO)) {
// logger.info("TraceID exist. continue trace. " + nextTraceId);
logger.info("TraceID exist. continue trace. " + traceId);
logger.log(Level.FINE, "requestUrl:" + requestURL + ", remoteAddr:" + remoteAddr);
}