You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@geode.apache.org by ds...@apache.org on 2019/05/17 20:28:50 UTC

[geode] branch develop updated: GEODE-6776: fix ClientStats and ClientSendStats (#3594)

This is an automated email from the ASF dual-hosted git repository.

dschneider pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/geode.git


The following commit(s) were added to refs/heads/develop by this push:
     new 7d13f37  GEODE-6776: fix ClientStats and ClientSendStats (#3594)
7d13f37 is described below

commit 7d13f37e4c662e96086ebfd3b47195bcad36e439
Author: Darrel Schneider <ds...@pivotal.io>
AuthorDate: Fri May 17 13:28:35 2019 -0700

    GEODE-6776: fix ClientStats and ClientSendStats (#3594)
    
    "sendStats" is now used instead of "stats" which is what caused the bug.
    A unit test now exists that checks that the correct send stats are incremented.
---
 .../cache/client/internal/ConnectionStats.java     |   84 +-
 .../cache/client/internal/ConnectionStatsTest.java | 1073 ++++++++++++++++++++
 2 files changed, 1118 insertions(+), 39 deletions(-)

diff --git a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionStats.java b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionStats.java
index e0adc66..a5ec1db 100644
--- a/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionStats.java
+++ b/geode-core/src/main/java/org/apache/geode/cache/client/internal/ConnectionStats.java
@@ -20,6 +20,7 @@ import org.apache.geode.StatisticsFactory;
 import org.apache.geode.StatisticsType;
 import org.apache.geode.StatisticsTypeFactory;
 import org.apache.geode.annotations.Immutable;
+import org.apache.geode.annotations.VisibleForTesting;
 import org.apache.geode.distributed.internal.DistributionStats;
 import org.apache.geode.internal.cache.PoolStats;
 import org.apache.geode.internal.cache.tier.sockets.MessageStats;
@@ -37,6 +38,11 @@ public class ConnectionStats implements MessageStats {
   @Immutable
   private static final StatisticsType sendType;
 
+  @VisibleForTesting
+  static StatisticsType getSendType() {
+    return sendType;
+  }
+
   ///////////////////////////////////////////////////////////////////////
   /*
    * private static final int opInProgressId; private static final int opSendInProgressId; private
@@ -1755,7 +1761,7 @@ public class ConnectionStats implements MessageStats {
       endGetSendId = getSendId;
     }
     this.sendStats.incInt(endGetSendId, 1);
-    this.stats.incLong(getSendDurationId, duration);
+    this.sendStats.incLong(getSendDurationId, duration);
   }
 
   /**
@@ -1821,7 +1827,7 @@ public class ConnectionStats implements MessageStats {
       endPutSendId = putSendId;
     }
     this.sendStats.incInt(endPutSendId, 1);
-    this.stats.incLong(putSendDurationId, duration);
+    this.sendStats.incLong(putSendDurationId, duration);
   }
 
   /**
@@ -1887,7 +1893,7 @@ public class ConnectionStats implements MessageStats {
       endDestroySendId = destroySendId;
     }
     this.sendStats.incInt(endDestroySendId, 1);
-    this.stats.incLong(destroySendDurationId, duration);
+    this.sendStats.incLong(destroySendDurationId, duration);
   }
 
   /**
@@ -1945,7 +1951,7 @@ public class ConnectionStats implements MessageStats {
       endDestroyRegionSendId = destroyRegionSendId;
     }
     this.sendStats.incInt(endDestroyRegionSendId, 1);
-    this.stats.incLong(destroyRegionSendDurationId, duration);
+    this.sendStats.incLong(destroyRegionSendDurationId, duration);
   }
 
   /**
@@ -2003,7 +2009,7 @@ public class ConnectionStats implements MessageStats {
       endClearSendId = clearSendId;
     }
     this.sendStats.incInt(endClearSendId, 1);
-    this.stats.incLong(clearSendDurationId, duration);
+    this.sendStats.incLong(clearSendDurationId, duration);
   }
 
   /**
@@ -2061,7 +2067,7 @@ public class ConnectionStats implements MessageStats {
       endContainsKeySendId = containsKeySendId;
     }
     this.sendStats.incInt(endContainsKeySendId, 1);
-    this.stats.incLong(containsKeySendDurationId, duration);
+    this.sendStats.incLong(containsKeySendDurationId, duration);
   }
 
   /**
@@ -2119,7 +2125,7 @@ public class ConnectionStats implements MessageStats {
       endKeySetSendId = keySetSendId;
     }
     this.sendStats.incInt(endKeySetSendId, 1);
-    this.stats.incLong(keySetSendDurationId, duration);
+    this.sendStats.incLong(keySetSendDurationId, duration);
   }
 
   /**
@@ -2177,7 +2183,7 @@ public class ConnectionStats implements MessageStats {
       endRegisterInterestSendId = registerInterestSendId;
     }
     this.sendStats.incInt(endRegisterInterestSendId, 1);
-    this.stats.incLong(registerInterestSendDurationId, duration);
+    this.sendStats.incLong(registerInterestSendDurationId, duration);
   }
 
   /**
@@ -2235,7 +2241,7 @@ public class ConnectionStats implements MessageStats {
       endUnregisterInterestSendId = unregisterInterestSendId;
     }
     this.sendStats.incInt(endUnregisterInterestSendId, 1);
-    this.stats.incLong(unregisterInterestSendDurationId, duration);
+    this.sendStats.incLong(unregisterInterestSendDurationId, duration);
   }
 
   /**
@@ -2293,7 +2299,7 @@ public class ConnectionStats implements MessageStats {
       endQuerySendId = querySendId;
     }
     this.sendStats.incInt(endQuerySendId, 1);
-    this.stats.incLong(querySendDurationId, duration);
+    this.sendStats.incLong(querySendDurationId, duration);
   }
 
   /**
@@ -2351,7 +2357,7 @@ public class ConnectionStats implements MessageStats {
       endCreateCQSendId = createCQSendId;
     }
     this.sendStats.incInt(endCreateCQSendId, 1);
-    this.stats.incLong(createCQSendDurationId, duration);
+    this.sendStats.incLong(createCQSendDurationId, duration);
   }
 
   /**
@@ -2409,7 +2415,7 @@ public class ConnectionStats implements MessageStats {
       endStopCQSendId = stopCQSendId;
     }
     this.sendStats.incInt(endStopCQSendId, 1);
-    this.stats.incLong(stopCQSendDurationId, duration);
+    this.sendStats.incLong(stopCQSendDurationId, duration);
   }
 
   /**
@@ -2467,7 +2473,7 @@ public class ConnectionStats implements MessageStats {
       endCloseCQSendId = closeCQSendId;
     }
     this.sendStats.incInt(endCloseCQSendId, 1);
-    this.stats.incLong(closeCQSendDurationId, duration);
+    this.sendStats.incLong(closeCQSendDurationId, duration);
   }
 
   /**
@@ -2525,7 +2531,7 @@ public class ConnectionStats implements MessageStats {
       endGetDurableCQsSendId = getDurableCQsSendId;
     }
     this.sendStats.incInt(endGetDurableCQsSendId, 1);
-    this.stats.incLong(getDurableCQsSendDurationId, duration);
+    this.sendStats.incLong(getDurableCQsSendDurationId, duration);
   }
 
   /**
@@ -2583,7 +2589,7 @@ public class ConnectionStats implements MessageStats {
       endGatewayBatchSendId = gatewayBatchSendId;
     }
     this.sendStats.incInt(endGatewayBatchSendId, 1);
-    this.stats.incLong(gatewayBatchSendDurationId, duration);
+    this.sendStats.incLong(gatewayBatchSendDurationId, duration);
   }
 
   /**
@@ -2641,7 +2647,7 @@ public class ConnectionStats implements MessageStats {
       endReadyForEventsSendId = readyForEventsSendId;
     }
     this.sendStats.incInt(endReadyForEventsSendId, 1);
-    this.stats.incLong(readyForEventsSendDurationId, duration);
+    this.sendStats.incLong(readyForEventsSendDurationId, duration);
   }
 
   /**
@@ -2699,7 +2705,7 @@ public class ConnectionStats implements MessageStats {
       endMakePrimarySendId = makePrimarySendId;
     }
     this.sendStats.incInt(endMakePrimarySendId, 1);
-    this.stats.incLong(makePrimarySendDurationId, duration);
+    this.sendStats.incLong(makePrimarySendDurationId, duration);
   }
 
   /**
@@ -2757,7 +2763,7 @@ public class ConnectionStats implements MessageStats {
       endCloseConSendId = closeConSendId;
     }
     this.sendStats.incInt(endCloseConSendId, 1);
-    this.stats.incLong(closeConSendDurationId, duration);
+    this.sendStats.incLong(closeConSendDurationId, duration);
   }
 
   /**
@@ -2815,7 +2821,7 @@ public class ConnectionStats implements MessageStats {
       endPrimaryAckSendId = primaryAckSendId;
     }
     this.sendStats.incInt(endPrimaryAckSendId, 1);
-    this.stats.incLong(primaryAckSendDurationId, duration);
+    this.sendStats.incLong(primaryAckSendDurationId, duration);
   }
 
   /**
@@ -2873,7 +2879,7 @@ public class ConnectionStats implements MessageStats {
       endPingSendId = pingSendId;
     }
     this.sendStats.incInt(endPingSendId, 1);
-    this.stats.incLong(pingSendDurationId, duration);
+    this.sendStats.incLong(pingSendDurationId, duration);
   }
 
   /**
@@ -2938,7 +2944,7 @@ public class ConnectionStats implements MessageStats {
       endRegisterInstantiatorsSendId = registerInstantiatorsSendId;
     }
     this.sendStats.incInt(endRegisterInstantiatorsSendId, 1);
-    this.stats.incLong(registerInstantiatorsSendDurationId, duration);
+    this.sendStats.incLong(registerInstantiatorsSendDurationId, duration);
   }
 
   public void endRegisterDataSerializersSend(long startTime, boolean failed) {
@@ -2952,7 +2958,7 @@ public class ConnectionStats implements MessageStats {
       endDataSerializersSendId = registerDataSerializersSendId;
     }
     this.sendStats.incInt(endDataSerializersSendId, 1);
-    this.stats.incLong(registerDataSerializersSendDurationId, duration);
+    this.sendStats.incLong(registerDataSerializersSendDurationId, duration);
   }
 
   /**
@@ -3026,7 +3032,7 @@ public class ConnectionStats implements MessageStats {
       endPutAllSendId = putAllSendId;
     }
     this.sendStats.incInt(endPutAllSendId, 1);
-    this.stats.incLong(putAllSendDurationId, duration);
+    this.sendStats.incLong(putAllSendDurationId, duration);
   }
 
   /**
@@ -3084,7 +3090,7 @@ public class ConnectionStats implements MessageStats {
       endRemoveAllSendId = removeAllSendId;
     }
     this.sendStats.incInt(endRemoveAllSendId, 1);
-    this.stats.incLong(removeAllSendDurationId, duration);
+    this.sendStats.incLong(removeAllSendDurationId, duration);
   }
 
   /**
@@ -3142,7 +3148,7 @@ public class ConnectionStats implements MessageStats {
       endGetAllSendId = getAllSendId;
     }
     this.sendStats.incInt(endGetAllSendId, 1);
-    this.stats.incLong(getAllSendDurationId, duration);
+    this.sendStats.incLong(getAllSendDurationId, duration);
   }
 
   /**
@@ -3263,7 +3269,7 @@ public class ConnectionStats implements MessageStats {
       endExecuteFunctionSendId = executeFunctionSendId;
     }
     this.sendStats.incInt(endExecuteFunctionSendId, 1);
-    this.stats.incLong(executeFunctionSendDurationId, duration);
+    this.sendStats.incLong(executeFunctionSendDurationId, duration);
   }
 
   /**
@@ -3332,7 +3338,7 @@ public class ConnectionStats implements MessageStats {
       endGetClientPRMetadataSendId = getClientPRMetadataSendId;
     }
     this.sendStats.incInt(endGetClientPRMetadataSendId, 1);
-    this.stats.incLong(getClientPRMetadataSendDurationId, duration);
+    this.sendStats.incLong(getClientPRMetadataSendDurationId, duration);
   }
 
   /**
@@ -3390,7 +3396,7 @@ public class ConnectionStats implements MessageStats {
       endGetClientPartitionAttributesSendId = getClientPartitionAttributesSendId;
     }
     this.sendStats.incInt(endGetClientPartitionAttributesSendId, 1);
-    this.stats.incLong(getClientPartitionAttributesSendDurationId, duration);
+    this.sendStats.incLong(getClientPartitionAttributesSendDurationId, duration);
   }
 
   /**
@@ -3441,7 +3447,7 @@ public class ConnectionStats implements MessageStats {
       endGetPDXTypeByIdSendId = getPDXTypeByIdSendId;
     }
     this.sendStats.incInt(endGetPDXTypeByIdSendId, 1);
-    this.stats.incLong(getPDXTypeByIdSendDurationId, duration);
+    this.sendStats.incLong(getPDXTypeByIdSendDurationId, duration);
   }
 
   public void endGetPDXIdForTypeSend(long startTime, boolean failed) {
@@ -3454,8 +3460,8 @@ public class ConnectionStats implements MessageStats {
     } else {
       endGetPDXIdForTypeSendId = getPDXIdForTypeSendId;
     }
-    this.stats.incInt(endGetPDXIdForTypeSendId, 1);
-    this.stats.incLong(getPDXIdForTypeSendDurationId, duration);
+    this.sendStats.incInt(endGetPDXIdForTypeSendId, 1);
+    this.sendStats.incLong(getPDXIdForTypeSendDurationId, duration);
   }
 
   public void endGetPDXTypeById(long startTime, boolean timedOut, boolean failed) {
@@ -3508,7 +3514,7 @@ public class ConnectionStats implements MessageStats {
       endAddPdxTypeSendId = addPdxTypeSendId;
     }
     this.sendStats.incInt(endAddPdxTypeSendId, 1);
-    this.stats.incLong(addPdxTypeSendDurationId, duration);
+    this.sendStats.incLong(addPdxTypeSendDurationId, duration);
   }
 
   public void endAddPdxType(long startTime, boolean timedOut, boolean failed) {
@@ -3545,7 +3551,7 @@ public class ConnectionStats implements MessageStats {
       endSizeSendId = sizeSendId;
     }
     this.sendStats.incInt(endSizeSendId, 1);
-    this.stats.incLong(sizeSendDurationId, duration);
+    this.sendStats.incLong(sizeSendDurationId, duration);
 
   }
 
@@ -3585,7 +3591,7 @@ public class ConnectionStats implements MessageStats {
       endInvalidateSendId = invalidateSendId;
     }
     this.sendStats.incInt(endInvalidateSendId, 1);
-    this.stats.incLong(invalidateSendDurationId, duration);
+    this.sendStats.incLong(invalidateSendDurationId, duration);
   }
 
   public void endInvalidate(long startTime, boolean timedOut, boolean failed) {
@@ -3622,7 +3628,7 @@ public class ConnectionStats implements MessageStats {
       endcommitSendId = commitSendId;
     }
     this.sendStats.incInt(endcommitSendId, 1);
-    this.stats.incLong(commitSendDurationId, duration);
+    this.sendStats.incLong(commitSendDurationId, duration);
   }
 
   public void endCommit(long startTime, boolean timedOut, boolean failed) {
@@ -3660,7 +3666,7 @@ public class ConnectionStats implements MessageStats {
       endGetEntrySendId = getEntrySendId;
     }
     this.sendStats.incInt(endGetEntrySendId, 1);
-    this.stats.incLong(getEntrySendDurationId, duration);
+    this.sendStats.incLong(getEntrySendDurationId, duration);
   }
 
   public void endGetEntry(long startTime, boolean timedOut, boolean failed) {
@@ -3698,7 +3704,7 @@ public class ConnectionStats implements MessageStats {
       endRollbackSendId = rollbackSendId;
     }
     this.sendStats.incInt(endRollbackSendId, 1);
-    this.stats.incLong(rollbackSendDurationId, duration);
+    this.sendStats.incLong(rollbackSendDurationId, duration);
   }
 
   public void endRollback(long startTime, boolean timedOut, boolean failed) {
@@ -3737,7 +3743,7 @@ public class ConnectionStats implements MessageStats {
       endTxFailoverSendId = txFailoverSendId;
     }
     this.sendStats.incInt(endTxFailoverSendId, 1);
-    this.stats.incLong(txFailoverSendDurationId, duration);
+    this.sendStats.incLong(txFailoverSendDurationId, duration);
   }
 
   public void endTxFailover(long startTime, boolean timedOut, boolean failed) {
@@ -3775,7 +3781,7 @@ public class ConnectionStats implements MessageStats {
       endTxSynchronizationSendId = txSynchronizationSendId;
     }
     this.sendStats.incInt(endTxSynchronizationSendId, 1);
-    this.stats.incLong(txSynchronizationSendDurationId, duration);
+    this.sendStats.incLong(txSynchronizationSendDurationId, duration);
   }
 
   public void endTxSynchronization(long startTime, boolean timedOut, boolean failed) {
diff --git a/geode-core/src/test/java/org/apache/geode/cache/client/internal/ConnectionStatsTest.java b/geode-core/src/test/java/org/apache/geode/cache/client/internal/ConnectionStatsTest.java
new file mode 100644
index 0000000..d72e085
--- /dev/null
+++ b/geode-core/src/test/java/org/apache/geode/cache/client/internal/ConnectionStatsTest.java
@@ -0,0 +1,1073 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.geode.cache.client.internal;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyLong;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import org.junit.Test;
+
+import org.apache.geode.Statistics;
+import org.apache.geode.StatisticsFactory;
+import org.apache.geode.internal.cache.PoolStats;
+
+public class ConnectionStatsTest {
+  private final Statistics sendStats = mock(Statistics.class);
+  private final StatisticsFactory statisticsFactory = createStatisticsFactory(sendStats);
+  private final PoolStats poolStats = mock(PoolStats.class);
+  private final ConnectionStats connectionStats =
+      new ConnectionStats(statisticsFactory, "name", poolStats);
+
+  private StatisticsFactory createStatisticsFactory(Statistics sendStats) {
+    StatisticsFactory statisticsFactory = mock(StatisticsFactory.class);
+    when(statisticsFactory.createAtomicStatistics(any(), eq("ClientSendStats-name")))
+        .thenReturn(sendStats);
+    return statisticsFactory;
+  }
+
+  @Test
+  public void endGetSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getSendTime");
+
+    connectionStats.endGetSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getSends");
+
+    connectionStats.endGetSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getSendFailures");
+
+    connectionStats.endGetSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPutSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("putSendTime");
+
+    connectionStats.endPutSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endPutSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("putSends");
+
+    connectionStats.endPutSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPutSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("putSendFailures");
+
+    connectionStats.endPutSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endDestroySendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("destroySendTime");
+
+    connectionStats.endDestroySend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endDestroySendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("destroySends");
+
+    connectionStats.endDestroySend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endDestroySendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("destroySendFailures");
+
+    connectionStats.endDestroySend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endDestroyRegionSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("destroyRegionSendTime");
+
+    connectionStats.endDestroyRegionSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endDestroyRegionSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("destroyRegionSends");
+
+    connectionStats.endDestroyRegionSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endDestroyRegionSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("destroyRegionSendFailures");
+
+    connectionStats.endDestroyRegionSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endClearSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("clearSendTime");
+
+    connectionStats.endClearSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endClearSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("clearSends");
+
+    connectionStats.endClearSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endClearSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("clearSendFailures");
+
+    connectionStats.endClearSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endContainsKeySendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("containsKeySendTime");
+
+    connectionStats.endContainsKeySend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endContainsKeySendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("containsKeySends");
+
+    connectionStats.endContainsKeySend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endContainsKeySendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("containsKeySendFailures");
+
+    connectionStats.endContainsKeySend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endKeySetSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("keySetSendTime");
+
+    connectionStats.endKeySetSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endKeySetSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("keySetSends");
+
+    connectionStats.endKeySetSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endKeySetSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("keySetSendFailures");
+
+    connectionStats.endKeySetSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRegisterInterestSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("registerInterestSendTime");
+
+    connectionStats.endRegisterInterestSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endRegisterInterestSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("registerInterestSends");
+
+    connectionStats.endRegisterInterestSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRegisterInterestSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("registerInterestSendFailures");
+
+    connectionStats.endRegisterInterestSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endUnregisterInterestSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("unregisterInterestSendTime");
+
+    connectionStats.endUnregisterInterestSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endUnregisterInterestSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("unregisterInterestSends");
+
+    connectionStats.endUnregisterInterestSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endUnregisterInterestSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("unregisterInterestSendFailures");
+
+    connectionStats.endUnregisterInterestSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endQuerySendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("querySendTime");
+
+    connectionStats.endQuerySend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endQuerySendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("querySends");
+
+    connectionStats.endQuerySend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endQuerySendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("querySendFailures");
+
+    connectionStats.endQuerySend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCreateCQSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("createCQSendTime");
+
+    connectionStats.endCreateCQSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endCreateCQSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("createCQSends");
+
+    connectionStats.endCreateCQSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCreateCQSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("createCQSendFailures");
+
+    connectionStats.endCreateCQSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endStopCQSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("stopCQSendTime");
+
+    connectionStats.endStopCQSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endStopCQSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("stopCQSends");
+
+    connectionStats.endStopCQSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endStopCQSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("stopCQSendFailures");
+
+    connectionStats.endStopCQSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCloseCQSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("closeCQSendTime");
+
+    connectionStats.endCloseCQSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endCloseCQSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("closeCQSends");
+
+    connectionStats.endCloseCQSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCloseCQSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("closeCQSendFailures");
+
+    connectionStats.endCloseCQSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetDurableCQsSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getDurableCQsSendTime");
+
+    connectionStats.endGetDurableCQsSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetDurableCQsSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getDurableCQsSends");
+
+    connectionStats.endGetDurableCQsSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetDurableCQsSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getDurableCQsSendFailures");
+
+    connectionStats.endGetDurableCQsSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGatewayBatchSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("gatewayBatchSendTime");
+
+    connectionStats.endGatewayBatchSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGatewayBatchSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("gatewayBatchSends");
+
+    connectionStats.endGatewayBatchSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGatewayBatchSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("gatewayBatchSendFailures");
+
+    connectionStats.endGatewayBatchSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endReadyForEventsSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("readyForEventsSendTime");
+
+    connectionStats.endReadyForEventsSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endReadyForEventsSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("readyForEventsSends");
+
+    connectionStats.endReadyForEventsSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endReadyForEventsSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("readyForEventsSendFailures");
+
+    connectionStats.endReadyForEventsSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endMakePrimarySendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("makePrimarySendTime");
+
+    connectionStats.endMakePrimarySend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endMakePrimarySendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("makePrimarySends");
+
+    connectionStats.endMakePrimarySend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endMakePrimarySendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("makePrimarySendFailures");
+
+    connectionStats.endMakePrimarySend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCloseConSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("closeConSendTime");
+
+    connectionStats.endCloseConSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endCloseConSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("closeConSends");
+
+    connectionStats.endCloseConSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCloseConSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("closeConSendFailures");
+
+    connectionStats.endCloseConSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPrimaryAckSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("primaryAckSendTime");
+
+    connectionStats.endPrimaryAckSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endPrimaryAckSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("primaryAckSends");
+
+    connectionStats.endPrimaryAckSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPrimaryAckSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("primaryAckSendFailures");
+
+    connectionStats.endPrimaryAckSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPingSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("pingSendTime");
+
+    connectionStats.endPingSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endPingSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("pingSends");
+
+    connectionStats.endPingSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPingSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("pingSendFailures");
+
+    connectionStats.endPingSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRegisterInstantiatorsSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("registerInstantiatorsSendTime");
+
+    connectionStats.endRegisterInstantiatorsSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endRegisterInstantiatorsSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("registerInstantiatorsSends");
+
+    connectionStats.endRegisterInstantiatorsSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRegisterInstantiatorsSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("registerInstantiatorsSendFailures");
+
+    connectionStats.endRegisterInstantiatorsSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRegisterDataSerializersSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("registerDataSerializersSendTime");
+
+    connectionStats.endRegisterDataSerializersSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endRegisterDataSerializersSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("registerDataSerializersSends");
+
+    connectionStats.endRegisterDataSerializersSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRegisterDataSerializersSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("registerDataSerializersSendFailures");
+
+    connectionStats.endRegisterDataSerializersSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPutAllSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("putAllSendTime");
+
+    connectionStats.endPutAllSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endPutAllSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("putAllSends");
+
+    connectionStats.endPutAllSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endPutAllSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("putAllSendFailures");
+
+    connectionStats.endPutAllSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRemoveAllSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("removeAllSendTime");
+
+    connectionStats.endRemoveAllSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endRemoveAllSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("removeAllSends");
+
+    connectionStats.endRemoveAllSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRemoveAllSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("removeAllSendFailures");
+
+    connectionStats.endRemoveAllSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetAllSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getAllSendTime");
+
+    connectionStats.endGetAllSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetAllSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getAllSends");
+
+    connectionStats.endGetAllSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetAllSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getAllSendFailures");
+
+    connectionStats.endGetAllSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endExecuteFunctionSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("executeFunctionSendTime");
+
+    connectionStats.endExecuteFunctionSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endExecuteFunctionSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("executeFunctionSends");
+
+    connectionStats.endExecuteFunctionSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endExecuteFunctionSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("executeFunctionSendFailures");
+
+    connectionStats.endExecuteFunctionSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetClientPRMetadataSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getClientPRMetadataSendTime");
+
+    connectionStats.endGetClientPRMetadataSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetClientPRMetadataSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getClientPRMetadataSendsSuccessful");
+
+    connectionStats.endGetClientPRMetadataSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetClientPRMetadataSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getClientPRMetadataSendFailures");
+
+    connectionStats.endGetClientPRMetadataSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetClientPartitionAttributesSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getClientPartitionAttributesSendTime");
+
+    connectionStats.endGetClientPartitionAttributesSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetClientPartitionAttributesSendIncsSendStatsSuccessfulOpCount() {
+    int statId =
+        ConnectionStats.getSendType().nameToId("getClientPartitionAttributesSendsSuccessful");
+
+    connectionStats.endGetClientPartitionAttributesSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetClientPartitionAttributesSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getClientPartitionAttributesSendFailures");
+
+    connectionStats.endGetClientPartitionAttributesSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetPDXTypeByIdSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getPDXTypeByIdSendTime");
+
+    connectionStats.endGetPDXTypeByIdSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetPDXTypeByIdSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getPDXTypeByIdSendsSuccessful");
+
+    connectionStats.endGetPDXTypeByIdSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetPDXTypeByIdSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getPDXTypeByIdSendFailures");
+
+    connectionStats.endGetPDXTypeByIdSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetPDXIdForTypeSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getPDXIdForTypeSendTime");
+
+    connectionStats.endGetPDXIdForTypeSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetPDXIdForTypeSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getPDXIdForTypeSendsSuccessful");
+
+    connectionStats.endGetPDXIdForTypeSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetPDXIdForTypeSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getPDXIdForTypeSendFailures");
+
+    connectionStats.endGetPDXIdForTypeSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endAddPdxTypeSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("addPdxTypeSendTime");
+
+    connectionStats.endAddPdxTypeSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endAddPdxTypeSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("addPdxTypeSendsSuccessful");
+
+    connectionStats.endAddPdxTypeSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endAddPdxTypeSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("addPdxTypeSendFailures");
+
+    connectionStats.endAddPdxTypeSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endSizeSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("sizeSendTime");
+
+    connectionStats.endSizeSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endSizeSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("sizeSends");
+
+    connectionStats.endSizeSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endSizeSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("sizeSendFailures");
+
+    connectionStats.endSizeSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endInvalidateSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("invalidateSendTime");
+
+    connectionStats.endInvalidateSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endInvalidateSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("invalidateSends");
+
+    connectionStats.endInvalidateSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endInvalidateSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("invalidateSendFailures");
+
+    connectionStats.endInvalidateSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCommitSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("commitSendTime");
+
+    connectionStats.endCommitSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endCommitSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("commitSends");
+
+    connectionStats.endCommitSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endCommitSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("commitSendFailures");
+
+    connectionStats.endCommitSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetEntrySendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("getEntrySendTime");
+
+    connectionStats.endGetEntrySend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endGetEntrySendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getEntrySends");
+
+    connectionStats.endGetEntrySend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endGetEntrySendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("getEntrySendFailures");
+
+    connectionStats.endGetEntrySend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRollbackSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("rollbackSendTime");
+
+    connectionStats.endRollbackSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endRollbackSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("rollbackSends");
+
+    connectionStats.endRollbackSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endRollbackSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("rollbackSendFailures");
+
+    connectionStats.endRollbackSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endTxFailoverSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("txFailoverSendTime");
+
+    connectionStats.endTxFailoverSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endTxFailoverSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("txFailoverSends");
+
+    connectionStats.endTxFailoverSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endTxFailoverSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("txFailoverSendFailures");
+
+    connectionStats.endTxFailoverSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endTxSynchronizationSendIncsStatIdOnSendStats() {
+    int statId = ConnectionStats.getSendType().nameToId("jtaSynchronizationSendTime");
+
+    connectionStats.endTxSynchronizationSend(1, false);
+
+    verify(sendStats).incLong(eq(statId), anyLong());
+  }
+
+  @Test
+  public void endTxSynchronizationSendIncsSendStatsSuccessfulOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("jtaSynchronizationSends");
+
+    connectionStats.endTxSynchronizationSend(1, false);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+  @Test
+  public void endTxSynchronizationSendIncsSendStatsFailureOpCount() {
+    int statId = ConnectionStats.getSendType().nameToId("jtaSynchronizationSendFailures");
+
+    connectionStats.endTxSynchronizationSend(1, true);
+
+    verify(sendStats).incInt(statId, 1);
+  }
+
+}