code: public void collectRequestStats(HttpRequestInfo req) {
          // ipv4/ipv6 tracking
          String clientIp;
          final String xForwardedFor = req.getHeaders().getFirst(X_FORWARDED_FOR_HEADER);
          if (xForwardedFor == null) {
              clientIp = req.getClientIp();
          } else {
              clientIp = extractClientIpFromXForwardedFor(xForwardedFor);
          }
  
          final boolean isIPv6 = (clientIp != null) ? isIPv6(clientIp) : false;
  
          final String ipVersionKey = isIPv6 ? "ipv6" : "ipv4";
          incrementNamedCountingMonitor(ipVersionKey, ipVersionCounterMap);
  
          // host header
          String host = req.getHeaders().getFirst(HOST_HEADER);
          if (host != null) {
              int colonIdx;
              if (isIPv6) {
                  // an ipv6 host might be a raw IP with 7+ colons
                  colonIdx = host.lastIndexOf(":");
              } else {
                  // strips port from host
                  colonIdx = host.indexOf(":");
              }
              if (colonIdx > -1) host = host.substring(0, colonIdx);
              incrementNamedCountingMonitor(hostKey(host), this.hostCounterMap);
          }
  
          // http vs. https
          String protocol = req.getHeaders().getFirst(X_FORWARDED_PROTO_HEADER);
          if (protocol == null) protocol = req.getScheme();
          incrementNamedCountingMonitor(protocolKey(protocol), this.protocolCounterMap);
  
  
      }
docs: Collects counts statistics about the request: client ip address from the x-forwarded-for header;
  ipv4 or ipv6 and  host name from the host header;
  
  @param req