mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-22 19:27:13 +10:00
[유치수] [NOBTS] add rpc time
git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-tomcat-profiler/trunk@789 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
@@ -27,6 +27,9 @@ public class Span {
|
||||
private final List<HippoAnnotation> annotations = new ArrayList<HippoAnnotation>(5);
|
||||
private final Set<String> annotationKeys = new HashSet<String>(5);
|
||||
|
||||
private long rpcStartTime;
|
||||
private long rpcEndTime;
|
||||
|
||||
/**
|
||||
* Cancel timer logic.
|
||||
* TODO: refactor this.
|
||||
@@ -50,6 +53,12 @@ public class Span {
|
||||
|
||||
public boolean addAnnotation(HippoAnnotation annotation) {
|
||||
annotationKeys.add(annotation.getKey());
|
||||
if (annotation.getKey().equals(Annotation.ClientSend.getCode()) || annotation.getKey().equals(Annotation.ServerRecv.getCode())) {
|
||||
rpcStartTime = annotation.getTimestamp();
|
||||
}
|
||||
if (annotation.getKey().equals(Annotation.ClientRecv.getCode()) || annotation.getKey().equals(Annotation.ServerSend.getCode())) {
|
||||
rpcEndTime = annotation.getTimestamp();
|
||||
}
|
||||
return annotations.add(annotation);
|
||||
}
|
||||
|
||||
@@ -99,6 +108,14 @@ public class Span {
|
||||
this.isTerminal = isTerminal;
|
||||
}
|
||||
|
||||
public long getRpcStartTime() {
|
||||
return rpcStartTime;
|
||||
}
|
||||
|
||||
public long getRpcEndTime() {
|
||||
return rpcEndTime;
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
@@ -134,6 +151,8 @@ public class Span {
|
||||
span.setEndPoint(endPoint);
|
||||
span.setTerminal(isTerminal);
|
||||
|
||||
// TODO: set duration.
|
||||
|
||||
List<com.profiler.common.dto.thrift.Annotation> annotationList = new ArrayList<com.profiler.common.dto.thrift.Annotation>(annotations.size());
|
||||
for (HippoAnnotation a : annotations) {
|
||||
annotationList.add(a.toThrift());
|
||||
|
||||
Reference in New Issue
Block a user