refactor: flow control filters v1

This commit is contained in:
hongqiaowei
2021-01-14 13:44:07 +08:00
parent d81f178b35
commit d3c8be33bd
2 changed files with 0 additions and 21 deletions

View File

@@ -27,7 +27,6 @@ import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -133,20 +132,6 @@ public class FlowStat {
return;
}
ResourceStat resourceStat = getResourceStat(resourceId);
long concurrents = resourceStat.getConcurrentRequests().get();
if (concurrents == 0) {
// RuntimeException e = new RuntimeException();
// log.warn(timeSlotId + " " + resourceId + " concurrents is zero", e);
StackTraceElement[] stackTraces = Thread.currentThread().getStackTrace();
StringBuilder b = new StringBuilder(timeSlotId + " " + resourceId + " concurrents is zero\n");
for (int i = 0; i < stackTraces.length; i++) {
b.append(stackTraces[i].toString()).append('\n');
}
log.warn(b.toString());
}
resourceStat.decrConcurrentRequest(timeSlotId);
}
@@ -173,7 +158,6 @@ public class FlowStat {
resourceStat = resourceStats.get(resourceId);
} else {
resourceStat = new ResourceStat(resourceId);
log.info("no resource stat for " + resourceId + " and create one");
ResourceStat rs = resourceStats.putIfAbsent(resourceId, resourceStat);
if (rs != null) {
resourceStat = rs;

View File

@@ -117,11 +117,6 @@ public class ResourceStat {
*/
public void decrConcurrentRequest(long timeSlotId) {
long conns = this.concurrentRequests.decrementAndGet();
if (conns == -1) {
log.warn(timeSlotId + " concurrents is one");
}
this.getTimeSlot(timeSlotId).updatePeakConcurrentReqeusts(conns);
}