From 2838bc418b2c1bdfbbbf77566209afdeb5ce549f Mon Sep 17 00:00:00 2001 From: hongqiaowei Date: Sat, 6 Aug 2022 11:01:37 +0800 Subject: [PATCH] Add node rps and concurrents to FizzGatewayNodeStatSchedConfig.java --- .../java/we/config/FizzGatewayNodeStatSchedConfig.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fizz-core/src/main/java/we/config/FizzGatewayNodeStatSchedConfig.java b/fizz-core/src/main/java/we/config/FizzGatewayNodeStatSchedConfig.java index 45a51e7..9a4f199 100644 --- a/fizz-core/src/main/java/we/config/FizzGatewayNodeStatSchedConfig.java +++ b/fizz-core/src/main/java/we/config/FizzGatewayNodeStatSchedConfig.java @@ -54,8 +54,8 @@ public class FizzGatewayNodeStatSchedConfig extends SchedConfig { public int port; public long ts; public long startTs; - public long concurrents = 0; - public double rps = 0; + public long concurrents; + public double rps; } private static final Logger LOGGER = LoggerFactory.getLogger(FizzGatewayNodeStatSchedConfig.class); @@ -74,7 +74,7 @@ public class FizzGatewayNodeStatSchedConfig extends SchedConfig { @Autowired(required = false) private FlowStat flowStat; - @Value("${izz-gateway-node-stat-sched.recent:3}") + @Value("${izz-gateway-node-stat-sched.recent:1}") private int recent; private Stat stat = new Stat(); @@ -95,6 +95,7 @@ public class FizzGatewayNodeStatSchedConfig extends SchedConfig { public void sched() { stat.ts = System.currentTimeMillis(); if (flowControl) { + stat.rps = 0; long currentTimeSlot = flowStat.currentTimeSlotId(); long startTimeSlot = currentTimeSlot - recent * 1000; List resourceTimeWindowStats = flowStat.getResourceTimeWindowStats(ResourceIdUtils.NODE_RESOURCE, startTimeSlot, currentTimeSlot, recent);