[유치수] [NOBTS] remove unnecessary endpoint variable.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@567 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2012-09-04 02:33:08 +00:00
parent 455f9c3bba
commit 01fd165bda
6 changed files with 9 additions and 32 deletions
@@ -1,6 +1,5 @@
package com.profiler.context;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
@@ -7,12 +7,9 @@ public class HippoAnnotation {
protected final Long duration;
protected final String threadname; // TODO: remove, just for debug.
protected EndPoint endPoint;
public HippoAnnotation(long time, String value, EndPoint endPoint, Long duration) {
public HippoAnnotation(long time, String value, Long duration) {
this.time = time;
this.value = value;
this.endPoint = endPoint;
this.duration = duration;
this.threadname = Thread.currentThread().getName();
}
@@ -21,10 +18,6 @@ public class HippoAnnotation {
return this.value;
}
public void setEndPoint(EndPoint endPoint) {
this.endPoint = endPoint;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@@ -33,7 +26,6 @@ public class HippoAnnotation {
sb.append("time=").append(time);
sb.append(", value=").append(value);
sb.append(", duration=").append(duration);
sb.append(", endpoint=").append(endPoint);
sb.append(", threadname=").append(threadname);
sb.append("}");
@@ -8,30 +8,23 @@ public class HippoBinaryAnnotation {
private final Long duration;
private final String threadname; // TODO: remove, just for debug.
private EndPoint endPoint;
public HippoBinaryAnnotation(long time, String key, Object value, EndPoint endPoint, Long duration) {
public HippoBinaryAnnotation(long time, String key, Object value, Long duration) {
this.time = time;
this.key = key;
this.value = value;
this.endPoint = endPoint;
this.duration = duration;
this.threadname = Thread.currentThread().getName();
}
public void setEndPoint(EndPoint endPoint) {
this.endPoint = endPoint;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("@={");
sb.append("time=").append(time);
sb.append(", key=").append(key);
sb.append(", value=").append(value);
sb.append(", duration=").append(duration);
sb.append(", endpoint=").append(endPoint);
sb.append(", threadname=").append(threadname);
sb.append("}");
@@ -69,13 +69,6 @@ public class Span {
public void setEndPoint(EndPoint endPoint) {
this.endPoint = endPoint;
for (HippoAnnotation annotation : annotations) {
annotation.setEndPoint(endPoint);
}
for (HippoBinaryAnnotation annotation : binaryAnnotations) {
annotation.setEndPoint(endPoint);
}
}
public String toString() {
@@ -7,7 +7,7 @@ import com.profiler.util.NamedThreadLocal;
* @author netspider
*
*/
public class Trace {
public final class Trace {
private static final DeadlineSpanMap spanMap = new DeadlineSpanMap();
@@ -97,7 +97,7 @@ public class Trace {
mutate(getTraceId(), new SpanUpdater() {
@Override
public Span updateSpan(Span span) {
span.addAnnotation(new HippoBinaryAnnotation(System.currentTimeMillis(), key, value, span.getEndPoint(), null));
span.addAnnotation(new HippoBinaryAnnotation(System.currentTimeMillis(), key, value, null));
return span;
}
});
@@ -145,7 +145,7 @@ public class Trace {
mutate(getTraceId(), new SpanUpdater() {
@Override
public Span updateSpan(Span span) {
span.addAnnotation(new HippoAnnotation(System.currentTimeMillis(), value, span.getEndPoint(), duration));
span.addAnnotation(new HippoAnnotation(System.currentTimeMillis(), value, duration));
return span;
}
});
@@ -59,14 +59,14 @@ public class ArcusClientModifier extends AbstractModifier {
code.append(" java.net.SocketAddress socketAddress = handlingNode.getSocketAddress();");
code.append(" if (socketAddress instanceof java.net.InetSocketAddress) {");
code.append(" java.net.InetSocketAddress addr = (java.net.InetSocketAddress) handlingNode.getSocketAddress();");
code.append(" com.profiler.context.Trace.recordServerAddr(addr.getHostName(), addr.getPort());");
code.append(" com.profiler.context.Trace.recordEndPoint(addr.getHostName(), addr.getPort());");
code.append(" }");
code.append(" com.profiler.context.Trace.recordRpcName(\"arcus\", ((cmd == null) ? \"UNKNOWN\" : new String(cmd.array())));");
code.append(" System.out.println(\"CS\");");
code.append(" com.profiler.context.Trace.record(new com.profiler.context.Annotation.ClientSend());");
code.append(" com.profiler.context.Trace.record(com.profiler.context.Annotation.ClientSend);");
code.append("} else if (newState == net.spy.memcached.ops.OperationState.COMPLETE) {");
code.append(" System.out.println(\"CR\");");
code.append(" com.profiler.context.Trace.record(new com.profiler.context.Annotation.ClientRecv());");
code.append(" com.profiler.context.Trace.record(com.profiler.context.Annotation.ClientRecv);");
code.append("}");
code.append("}");