...
|
...
|
@@ -66,7 +66,7 @@ public class ApiStatisticsAnalyzer implements Serializable { |
|
|
while (itor.hasNext()) {
|
|
|
SpanInfo span = (SpanInfo) itor.next();
|
|
|
SpanResult spanResult = new SpanResult(span.getName(), span.getEnd() - span.getBegin(), span.getLevel(),
|
|
|
span.getSpanid(), span.getParent(), span.getSrcService(), span.getDstService(), null, null,span.isErrorStatus(),span.getSpanType());
|
|
|
span.getSpanid(), span.getParent(), span.getSrcService(), span.getDstService(), null, null,span.getErrorCount(),span.getSpanType());
|
|
|
spanResultList.add(spanResult);
|
|
|
}
|
|
|
|
...
|
...
|
@@ -106,8 +106,13 @@ public class ApiStatisticsAnalyzer implements Serializable { |
|
|
|
|
|
int size = v1.getSpans().size() ;
|
|
|
for(int i=0; i<size; i++){
|
|
|
//计算span平均耗时
|
|
|
long d = (v1.getSpans().get(i).getDuration() * v1.getCallTimes() + v2.getSpans().get(i).getDuration() * v2.getCallTimes() ) / result.getCallTimes() ;
|
|
|
v1.getSpans().get(i).setDuration(d);
|
|
|
|
|
|
//计算span异常次数
|
|
|
int errorCount = v1.getSpans().get(i).getErrorCount() + v2.getSpans().get(i).getErrorCount();
|
|
|
v1.getSpans().get(i).setErrorCount(errorCount);
|
|
|
}
|
|
|
|
|
|
result.setSpans(v1.getSpans());
|
...
|
...
|
@@ -188,7 +193,7 @@ public class ApiStatisticsAnalyzer implements Serializable { |
|
|
while(it.hasNext()) {
|
|
|
SpanInfo si = (SpanInfo)it.next();
|
|
|
key.append(si.getName()+"|");
|
|
|
if(si.isErrorStatus()){
|
|
|
if(si.getErrorCount()>0){
|
|
|
traceErrorStatus = true;
|
|
|
}
|
|
|
if(si.getSpanType()== SpanType.RESTTEMPLATE){
|
...
|
...
|
|