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

View File

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