[유치수] [NOBTS] call stack을 위한 수정, depth, nextid 추가. traceid를 rpc call하기 전에 next id를 발급하도록 변경.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1113 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2013-01-24 04:53:17 +00:00
parent 09fb7f49a7
commit 750352c96f
13 changed files with 333 additions and 197 deletions
@@ -1,11 +1,11 @@
package com.profiler.context;
import com.profiler.Agent;
import com.profiler.common.ServiceType;
import java.util.ArrayList;
import java.util.List;
import com.profiler.Agent;
import com.profiler.common.ServiceType;
/**
* Span represent RPC
*
@@ -27,6 +27,9 @@ public class SubSpan implements Thriftable {
private final List<HippoAnnotation> annotations = new ArrayList<HippoAnnotation>(5);
private Long nextSpanId = null;
private Integer depth = null;
public SubSpan(Span parentSpan) {
this.parentSpan = parentSpan;
}
@@ -110,13 +113,31 @@ public class SubSpan implements Thriftable {
public void setException(boolean exception) {
this.exception = exception;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
public long getNextSpanId() {
return nextSpanId;
}
public void setNextSpanId(long nextSpanId) {
this.nextSpanId = nextSpanId;
}
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
sb.append("\n\t Depth = ").append(depth);
sb.append("\n\t NextSpanid=").append(nextSpanId);
sb.append("\n\t ParentTraceID=").append(parentSpan.getTraceID());
sb.append("\n\t sequence=").append(sequence);
sb.append("\n\t Sequence=").append(sequence);
sb.append(",\n\t StartTime=").append(startTime);
sb.append(", EndTime=").append(endTime);
sb.append(",\n\t Name=").append(rpc);
@@ -174,6 +195,14 @@ public class SubSpan implements Thriftable {
}
subSpan.setAnnotations(annotationList);
if (depth != null) {
subSpan.setDepth(depth);
}
if (nextSpanId != null) {
subSpan.setNextSpanId(nextSpanId);
}
return subSpan;
}
}