[강운덕] [LUCYSUS-1744] profiler에서 수집 데이터를 일정량 모아서 한번에 flush하는 로직 개발.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1035 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2012-12-18 05:58:37 +00:00
parent ce0678d070
commit 75480a22ac
10 changed files with 450 additions and 185 deletions
@@ -34,7 +34,7 @@ public class SubSpan implements Thriftable {
return parentSpan;
}
public int getSequence() {
public short getSequence() {
return sequence;
}
@@ -46,6 +46,10 @@ public class SubSpan implements Thriftable {
return annotations.add(annotation);
}
public List<HippoAnnotation> getAnnotations() {
return annotations;
}
public int getAnnotationSize() {
return annotations.size();
}
@@ -123,21 +127,31 @@ public class SubSpan implements Thriftable {
}
public com.profiler.common.dto.thrift.SubSpan toThrift() {
return toThrift(false);
}
public com.profiler.common.dto.thrift.SubSpan toThrift(boolean child) {
com.profiler.common.dto.thrift.SubSpan span = new com.profiler.common.dto.thrift.SubSpan();
span.setAgentId(Agent.getInstance().getAgentId());
long parentSpanStartTime = parentSpan.getStartTime();
span.setStartElapsed((int) (startTime - parentSpanStartTime));
span.setEndElapsed((int) (endTime - startTime));
TraceID parentSpanTraceID = parentSpan.getTraceID();
span.setMostTraceId(parentSpanTraceID.getId().getMostSignificantBits());
span.setLeastTraceId(parentSpanTraceID.getId().getLeastSignificantBits());
// 다른 span의 sub로 들어가지 않을 경우
if (!child) {
span.setAgentId(Agent.getInstance().getAgentId());
TraceID parentSpanTraceID = parentSpan.getTraceID();
span.setMostTraceId(parentSpanTraceID.getId().getMostSignificantBits());
span.setLeastTraceId(parentSpanTraceID.getId().getLeastSignificantBits());
span.setSpanId(parentSpanTraceID.getSpanId());
span.setSequence(sequence);
}
span.setRpc(rpc);
span.setServiceName(serviceName);
span.setServiceType(serviceType.getCode());
span.setSpanId(parentSpanTraceID.getSpanId());
span.setSequence(sequence);
span.setEndPoint(endPoint);