rename totalRt variable

This commit is contained in:
Francis Dong
2020-12-22 11:26:01 +08:00
parent 96cb46bd3d
commit 625fb0c41b
2 changed files with 9 additions and 9 deletions

View File

@@ -76,7 +76,7 @@ public class RouteStat {
long min = Long.MAX_VALUE;
long max = Long.MIN_VALUE;
long totalReqs = 0;
long totalRts = 0;
long totalRt = 0;
int peakConcurrences = 0;
long errors = 0;
for (long i = startSlotId; i < endSlotId;) {
@@ -88,7 +88,7 @@ public class RouteStat {
? timeSlot.getPeakConcurrentReqeusts()
: peakConcurrences;
totalReqs = totalReqs + timeSlot.getCounter().get();
totalRts = totalRts + timeSlot.getTotalRts().get();
totalRt = totalRt + timeSlot.getTotalRt().get();
errors = errors + timeSlot.getErrors().get();
}
i = i + FlowStat.INTERVAL;
@@ -100,7 +100,7 @@ public class RouteStat {
tws.setErrors(errors);
if (totalReqs > 0) {
tws.setAvgRt(totalRts / totalReqs);
tws.setAvgRt(totalRt / totalReqs);
BigDecimal nsec = new BigDecimal(endSlotId - startSlotId).divide(new BigDecimal(1000), 5,
BigDecimal.ROUND_HALF_UP);

View File

@@ -37,7 +37,7 @@ public class TimeSlot {
/**
* Total response time
*/
private AtomicLong totalRts = new AtomicLong(0);
private AtomicLong totalRt = new AtomicLong(0);
/**
* Peak concurrent requests
@@ -61,7 +61,7 @@ public class TimeSlot {
*/
public synchronized void incr(long rt, int concurrentRequests, boolean isSuccess) {
counter.incrementAndGet();
totalRts.addAndGet(rt);
totalRt.addAndGet(rt);
if (!isSuccess) {
errors.incrementAndGet();
}
@@ -99,12 +99,12 @@ public class TimeSlot {
this.max = max;
}
public AtomicLong getTotalRts() {
return totalRts;
public AtomicLong getTotalRt() {
return totalRt;
}
public void setTotalRts(AtomicLong totalRts) {
this.totalRts = totalRts;
public void setTotalRt(AtomicLong totalRt) {
this.totalRt = totalRt;
}
public int getPeakConcurrentReqeusts() {