Authored by skinny.wu

redis caps值计算公式 修改

... ... @@ -21,7 +21,6 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.HashMap;
... ... @@ -53,9 +52,9 @@ public class RedisMonitorHandleServiceImpl implements IRedisMonitorHandleService
@Autowired
private SnsMobileConfig snsMobileConfig;
private static Map<String, Long> lastUpTimeMap = new HashMap<>();
private Map<String, Long> lastUpTimeMap = new HashMap<>();
private static Map<String, Long> lastRequestCountMap = new HashMap<>();
private Map<String, Long> lastRequestCountMap = new HashMap<>();
@Override
public void redisMonitor() {
... ... @@ -185,7 +184,7 @@ public class RedisMonitorHandleServiceImpl implements IRedisMonitorHandleService
long lastRequestCount = lastRequestCountMap.get(ipString);
long lastUpTime = lastUpTimeMap.get(ipString);
caps = (requestCount - lastRequestCount) * 1.0 / ((upTime - lastUpTime) * 1000) / redisCount;
caps = (requestCount - lastRequestCount) * 1.0 / (upTime - lastUpTime) / redisCount;
}
//将当前的uptime request数据存到map中
... ...