From 52a33fecbe37ccf6b97f9637745bb03107349283 Mon Sep 17 00:00:00 2001
From: Chris Ridd <chris.ridd@forgerock.com>
Date: Thu, 15 Nov 2012 16:28:43 +0000
Subject: [PATCH] Fix OPENDJ-637 - Connection handler bytesRead and bytesWritten statistics are wrong

---
 opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java b/opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java
index 28ab04d..26a3009 100644
--- a/opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java
+++ b/opends/src/server/org/opends/server/protocols/ldap/LDAPStatistics.java
@@ -491,6 +491,20 @@
 
 
   /**
+   * Updates the appropriate set of counters to indicate that the
+   * specified number of bytes have been written to the client.
+   *
+   * @param bytesWritten
+   *          The number of bytes written to the client.
+   */
+  public void updateBytesWritten(int bytesWritten)
+  {
+     this.bytesWritten.getAndAdd(bytesWritten);
+  }
+
+
+
+  /**
    * Updates the appropriate set of counters based on the provided
    * message that has been read from the client.
    *
@@ -562,12 +576,9 @@
    *
    * @param message
    *          The message that was written to the client.
-   * @param bytesWritten
-   *          The size of the message written in bytes.
    */
-  public void updateMessageWritten(LDAPMessage message, int bytesWritten)
+  public void updateMessageWritten(LDAPMessage message)
   {
-      this.bytesWritten.getAndAdd(bytesWritten);
       messagesWritten.getAndIncrement();
 
       switch (message.getProtocolOp().getType())

--
Gitblit v1.10.0