public void addClientRequest(InvokerContext context, boolean failed) {
    if (configManager.getBooleanValue(KEY_REQUEST_QUALITY_AUTO, false)
        && context.getClient() != null) {

      String address = context.getClient().getAddress();
      ConcurrentHashMap<String, ConcurrentHashMap<Integer, Quality>> requestSecondQuality =
          addrReqUrlSecondQualities.get(address);
      if (requestSecondQuality == null) {
        requestSecondQuality = new ConcurrentHashMap<String, ConcurrentHashMap<Integer, Quality>>();
        ConcurrentHashMap<String, ConcurrentHashMap<Integer, Quality>> last =
            addrReqUrlSecondQualities.putIfAbsent(address, requestSecondQuality);
        if (last != null) {
          requestSecondQuality = last;
        }
      }

      String requestUrl = getRequestUrl(context);
      ConcurrentHashMap<Integer, Quality> secondQuality = requestSecondQuality.get(requestUrl);
      if (secondQuality == null) {
        secondQuality = new ConcurrentHashMap<Integer, Quality>();
        ConcurrentHashMap<Integer, Quality> last =
            requestSecondQuality.putIfAbsent(requestUrl, secondQuality);
        if (last != null) {
          secondQuality = last;
        }
      }

      int currentSecond = Calendar.getInstance().get(Calendar.SECOND);
      Quality quality = secondQuality.get(currentSecond);
      if (quality == null) {
        quality = new Quality(0, 0);
        Quality last = secondQuality.putIfAbsent(currentSecond, quality);
        if (last != null) {
          quality = last;
        }
      }

      quality.total.incrementAndGet();
      if (failed) {
        quality.failed.incrementAndGet();
      }
    }
  }
 static {
   configManager.getBooleanValue(KEY_REQUEST_QUALITY_AUTO, false);
   configManager.getIntValue(KEY_REQUEST_QUALITY_THRESHOLD_TOTAL, 20);
   configManager.getFloatValue(KEY_REQUEST_QUALITY_FAILED_PERCENT_GOOD, 1f);
   configManager.getFloatValue(KEY_REQUEST_QUALITY_FAILED_PERCENT_NORMAL, 5f);
 }
 public boolean isEnableRequestQualityRoute() {
   return configManager.getBooleanValue(KEY_REQUEST_QUALITY_AUTO, false);
 }