[강운덕] [LUCYSUS-1744] SubSpan을 Event로 변경함.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@1270 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Woonduk Kang
2013-02-28 07:37:22 +00:00
parent c468844a19
commit ab9690dbda
4 changed files with 14 additions and 11 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ package com.profiler.context;
import com.profiler.Agent;
import com.profiler.common.ServiceType;
import com.profiler.common.dto.thrift.Event;
import java.util.ArrayList;
import java.util.List;
@@ -175,9 +176,9 @@ public class Span implements Thriftable {
List<SubSpan> subSpanList = this.getSubSpanList();
if (subSpanList != null && subSpanList.size() != 0) {
List<com.profiler.common.dto.thrift.SubSpan> tSubSpanList = new ArrayList<com.profiler.common.dto.thrift.SubSpan>(subSpanList.size());
List<Event> tSubSpanList = new ArrayList<Event>(subSpanList.size());
for (SubSpan subSpan : subSpanList) {
com.profiler.common.dto.thrift.SubSpan tSubSpan = subSpan.toThrift(true);
Event tSubSpan = subSpan.toThrift(true);
tSubSpanList.add(tSubSpan);
}
span.setSubSpanList(tSubSpanList);
@@ -1,6 +1,7 @@
package com.profiler.context;
import com.profiler.Agent;
import com.profiler.common.dto.thrift.Event;
import org.apache.thrift.TBase;
import java.util.ArrayList;
@@ -32,17 +33,17 @@ public class SpanChunk implements Thriftable {
tSpanChunk.setLeastTraceId(id.getLeastSignificantBits());
tSpanChunk.setSpanId(parentSpan.getTraceID().getSpanId());
List<com.profiler.common.dto.thrift.SubSpan> tSubSpan = createSubSpan(subSpanList);
List<Event> tSubSpan = createSubSpan(subSpanList);
tSpanChunk.setSubSpanList(tSubSpan);
return tSpanChunk;
}
private List<com.profiler.common.dto.thrift.SubSpan> createSubSpan(List<SubSpan> subSpanList) {
List<com.profiler.common.dto.thrift.SubSpan> result = new ArrayList<com.profiler.common.dto.thrift.SubSpan>(subSpanList.size());
private List<Event> createSubSpan(List<SubSpan> subSpanList) {
List<Event> result = new ArrayList<Event>(subSpanList.size());
for (SubSpan subSpan : subSpanList) {
com.profiler.common.dto.thrift.SubSpan tSubSpan = new com.profiler.common.dto.thrift.SubSpan();
Event tSubSpan = new Event();
tSubSpan.setAgentId(Agent.getInstance().getAgentId());
tSubSpan.setAgentIdentifier(Agent.getInstance().getIdentifier());
@@ -12,14 +12,14 @@ public interface Storage {
DataSender getDataSender();
/**
* store(SubSpan subSpan)와 store(Span span)간 동기화가 구현되어 있어야 한다.
* store(Event subSpan)와 store(Span span)간 동기화가 구현되어 있어야 한다.
*
* @param subSpan
*/
void store(SubSpan subSpan);
/**
* store(SubSpan subSpan)와 store(Span span)간 동기화가 구현되어 있어야 한다.
* store(Event subSpan)와 store(Span span)간 동기화가 구현되어 있어야 한다.
*
* @param span
*/
@@ -5,6 +5,7 @@ import java.util.List;
import com.profiler.Agent;
import com.profiler.common.ServiceType;
import com.profiler.common.dto.thrift.Event;
/**
* Span represent RPC
@@ -169,12 +170,12 @@ public class SubSpan implements Thriftable {
return sb.toString();
}
public com.profiler.common.dto.thrift.SubSpan toThrift() {
public Event toThrift() {
return toThrift(false);
}
public com.profiler.common.dto.thrift.SubSpan toThrift(boolean child) {
com.profiler.common.dto.thrift.SubSpan subSpan = new com.profiler.common.dto.thrift.SubSpan();
public Event toThrift(boolean child) {
Event subSpan = new Event();
long parentSpanStartTime = parentSpan.getStartTime();
subSpan.setStartElapsed((int) (startTime - parentSpanStartTime));