提交 696dbd03 编写于 作者: Y youyong205

fix bug

上级 78c8d25c
......@@ -28,6 +28,8 @@ public class DomainInfo {
private long m_fail;
private double m_sum;
public double getAvg() {
return m_avg;
}
......@@ -40,13 +42,13 @@ public class DomainInfo {
return m_fail;
}
public Item setAvg(double avg) {
m_avg = avg;
return this;
}
public Item setValue(long count, double sum) {
m_count = m_count + count;
m_sum = m_sum + sum;
public Item setCount(long count) {
m_count = count;
if (m_count > 0) {
m_avg = m_sum / m_count;
}
return this;
}
......@@ -66,7 +68,6 @@ public class DomainInfo {
m_exception = m_exception + count;
}
public Item get(String key) {
Item item = m_items.get(key);
......
......@@ -25,6 +25,9 @@ public class TransactionReportVisitor extends BaseVisitor {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:");
m_date = sdf.format(transactionReport.getStartTime());
System.err.println(transactionReport);
super.visitTransactionReport(transactionReport);
}
......@@ -62,6 +65,6 @@ public class TransactionReportVisitor extends BaseVisitor {
}
Metric metric = m_info.getMetric(key);
metric.get(m_type).setFail(range.getFails()).setCount(range.getCount()).setAvg(range.getCount());
metric.get(m_type).setFail(range.getFails()).setValue(range.getCount(), range.getSum());
}
}
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册