update timeslot while decrease concurrent request
This commit is contained in:
@@ -31,7 +31,7 @@ public class FlowStat {
|
|||||||
/**
|
/**
|
||||||
* A string Resource ID as key
|
* A string Resource ID as key
|
||||||
*/
|
*/
|
||||||
public ConcurrentMap<String, ResourceStat> resourceStats = new ConcurrentHashMap<>();
|
public ConcurrentMap<String, ResourceStat> resourceStats = new ConcurrentHashMap<>(100);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retention time of statistic data
|
* Retention time of statistic data
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ public class ResourceStat {
|
|||||||
/**
|
/**
|
||||||
* Request count of time slot, the beginning timestamp(timeId) as key
|
* Request count of time slot, the beginning timestamp(timeId) as key
|
||||||
*/
|
*/
|
||||||
private ConcurrentMap<Long, TimeSlot> timeSlots = new ConcurrentHashMap<>();
|
private ConcurrentMap<Long, TimeSlot> timeSlots = new ConcurrentHashMap<>(100);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Concurrent requests
|
* Concurrent requests
|
||||||
@@ -94,7 +94,8 @@ public class ResourceStat {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public void decrConcurrentRequest(long timeSlotId) {
|
public void decrConcurrentRequest(long timeSlotId) {
|
||||||
this.concurrentRequests.decrementAndGet();
|
long conns = this.concurrentRequests.decrementAndGet();
|
||||||
|
this.getTimeSlot(timeSlotId).updatePeakConcurrentReqeusts(conns);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user