mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Jean-Noël Rouvignac
25.17.2016 01bf9b6a5d324d45355659581e9ebbd1280834fe
opendj-server-legacy/src/main/java/org/opends/server/protocols/http/HTTPStatistics.java
@@ -33,7 +33,6 @@
 */
public class HTTPStatistics extends LDAPStatistics
{
  /**
   * Map containing the total number of requests per HTTP methods.
   * <p>
@@ -43,7 +42,7 @@
   * The keys are static because they need to be listed in the schema which is
   * static.
   */
  private Map<String, AtomicInteger> requestMethodsTotalCount = new HashMap<>();
  private final Map<String, AtomicInteger> requestMethodsTotalCount = new HashMap<>();
  /**
   * Map containing the total execution time for the requests per HTTP methods.
   * <p>
@@ -54,13 +53,13 @@
   * The keys are static because they need to be listed in the schema which is
   * static.
   */
  private Map<String, AtomicLong> requestMethodsTotalTime = new HashMap<>();
  private final Map<String, AtomicLong> requestMethodsTotalTime = new HashMap<>();
  /**
   * Total number of requests. The total number may be different than the sum of
   * the supported HTTP methods above because clients could use unsupported HTTP
   * methods.
   */
  private AtomicInteger requestsTotalCount = new AtomicInteger(0);
  private final AtomicInteger requestsTotalCount = new AtomicInteger(0);
  /**
   * Constructor for this class.
@@ -115,26 +114,6 @@
  }
  /**
   * Adds a request to the stats using the provided HTTP method.
   *
   * @param httpMethod
   *          the method of the HTTP request to add to the stats
   * @throws NullPointerException
   *           if the httpMethod is null
   */
  public void addRequest(String httpMethod) throws NullPointerException
  {
    AtomicInteger nb =
        this.requestMethodsTotalCount.get(httpMethod.toLowerCase());
    if (nb != null)
    {
      nb.incrementAndGet();
    } // else this is an unsupported HTTP method
    // always count any requests regardless of whether the method is supported
    this.requestsTotalCount.incrementAndGet();
  }
  /**
   * Adds to the total time of an HTTP request method.
   *
   * @param httpMethod