[유치수] [NOBTS] show each transaction processing time.

git-svn-id: http://svn.bds.nhncorp.com/pe/hippo-web/trunk@816 84d0f5b1-2673-498c-a247-62c4ff18d310
This commit is contained in:
Chisu Yu
2012-10-23 04:47:10 +00:00
parent e9be7ffd5f
commit c7e7dd3fcb
4 changed files with 50 additions and 26 deletions
@@ -8,7 +8,7 @@ import com.profiler.common.bo.AnnotationBo;
import com.profiler.common.bo.SpanBo;
public class BusinessTransaction {
private final List<String> traces = new ArrayList<String>();
private final List<Trace> traces = new ArrayList<Trace>();
private final String name;
private int calls = 0;
@@ -18,8 +18,6 @@ public class BusinessTransaction {
public BusinessTransaction(SpanBo span) {
this.name = span.getName();
this.traces.add(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString());
calls++;
List<AnnotationBo> annotations = span.getAnnotationBoList();
long begin = 0;
@@ -34,14 +32,12 @@ public class BusinessTransaction {
}
long elapsed = end - begin;
totalTime = maxTime = minTime = elapsed;
this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed));
calls++;
}
public void add(SpanBo span) {
this.traces.add(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString());
if (span.getParentSpanId() == -1) {
calls++;
}
List<AnnotationBo> annotations = span.getAnnotationBoList();
long begin = 0;
long end = 0;
@@ -59,13 +55,19 @@ public class BusinessTransaction {
maxTime = elapsed;
if (minTime > elapsed)
minTime = elapsed;
this.traces.add(new Trace(new UUID(span.getMostTraceId(), span.getLeastTraceId()).toString(), elapsed));
if (span.getParentSpanId() == -1) {
calls++;
}
}
public String getName() {
return name;
}
public List<String> getTraces() {
public List<Trace> getTraces() {
return traces;
}
@@ -0,0 +1,20 @@
package com.nhn.hippo.web.vo;
public class Trace {
private final String traceId;
private final long time;
public Trace(String traceId, long time) {
this.traceId = traceId;
this.time = time;
}
public String getTraceId() {
return traceId;
}
public long getTime() {
return time;
}
}