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

Jean-Noel Rouvignac
21.47.2013 d13f4bb71bcd9e903cd87e6f2625a9f8dc1b5ed6
opends/src/server/org/opends/server/protocols/http/HTTPClientConnection.java
@@ -186,6 +186,9 @@
  private final HTTPStatistics statTracker;
  private boolean useNanoTime = false;
  /** Total execution time for this request. */
  private AtomicLong totalProcessingTime = new AtomicLong();
  /** The protocol in use for this client connection. */
  private String protocol;
@@ -298,6 +301,13 @@
  /** {@inheritDoc} */
  @Override
  public long getTotalProcessingTime()
  {
    return totalProcessingTime.get();
  }
  /** {@inheritDoc} */
  @Override
  public String getProtocol()
  {
    return protocol;
@@ -370,17 +380,11 @@
  @Override
  public void sendResponse(Operation operation)
  {
    final long time = getProcessingTime(operation);
    this.totalProcessingTime.addAndGet(time);
    if (keepStats)
    {
      long time;
      if (useNanoTime)
      {
        time = operation.getProcessingNanoTime();
      }
      else
      {
        time = operation.getProcessingTime();
      }
      this.statTracker.updateRequestMonitoringData(getMethod(), time);
      this.statTracker.updateOperationMonitoringData(operation
          .getOperationType(), time);
@@ -407,6 +411,15 @@
    }
  }
  private long getProcessingTime(Operation operation)
  {
    if (useNanoTime)
    {
      return operation.getProcessingNanoTime();
    }
    return operation.getProcessingTime();
  }
  private ProtocolOp toResponseProtocolOp(Operation operation)
  {
    final int resultCode = operation.getResultCode().getIntValue();