geode-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bschucha...@apache.org
Subject incubator-geode git commit: GEODE-77 fixing statistics recording in StatRecorderJUnitTest
Date Tue, 15 Sep 2015 17:52:49 GMT
Repository: incubator-geode
Updated Branches:
  refs/heads/feature/GEODE-77 43a368831 -> fc2881710


GEODE-77 fixing statistics recording in StatRecorderJUnitTest


Project: http://git-wip-us.apache.org/repos/asf/incubator-geode/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-geode/commit/fc288171
Tree: http://git-wip-us.apache.org/repos/asf/incubator-geode/tree/fc288171
Diff: http://git-wip-us.apache.org/repos/asf/incubator-geode/diff/fc288171

Branch: refs/heads/feature/GEODE-77
Commit: fc28817106ae8e534e56913426f7955efdc6d58f
Parents: 43a3688
Author: Bruce Schuchardt <bschuchardt@pivotal.io>
Authored: Tue Sep 15 10:52:35 2015 -0700
Committer: Bruce Schuchardt <bschuchardt@pivotal.io>
Committed: Tue Sep 15 10:52:35 2015 -0700

----------------------------------------------------------------------
 .../gms/membership/StatRecorderJUnitTest.java   | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-geode/blob/fc288171/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/StatRecorderJUnitTest.java
----------------------------------------------------------------------
diff --git a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/StatRecorderJUnitTest.java
b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/StatRecorderJUnitTest.java
index 99cba22..fb50290 100755
--- a/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/StatRecorderJUnitTest.java
+++ b/gemfire-core/src/test/java/com/gemstone/gemfire/distributed/internal/membership/gms/membership/StatRecorderJUnitTest.java
@@ -59,9 +59,11 @@ public class StatRecorderJUnitTest {
     Event evt = new Event(Event.MSG, msg);
     recorder.up(evt);
     assert stats.ucastMessagesReceived == 1 : "stats.ucastMessagesReceived =" + stats.ucastMessagesReceived;
+    assert stats.ucastMessageBytesReceived == 150;
     
     recorder.down(evt);
     assert stats.ucastMessagesSent == 1 : "stats.ucastMessagesSent =" + stats.ucastMessagesSent;
+    assert stats.ucastMessageBytesSent == 150;
     
     when(msg.getHeader(any(Short.class))).thenReturn(Header.createXmitReqHeader());
     recorder.up(evt);
@@ -80,9 +82,11 @@ public class StatRecorderJUnitTest {
     Event evt = new Event(Event.MSG, msg);
     recorder.up(evt);
     assert stats.mcastMessagesReceived == 1 : "mcastMessagesReceived = " + stats.mcastMessagesReceived;
+    assert stats.mcastMessageBytesReceived == 150;
     
     recorder.down(evt);
     assert stats.mcastMessagesSent == 1 : "mcastMessagesSent = " + stats.mcastMessagesSent;
+    assert stats.mcastMessageBytesSent == 150;
     
     when(msg.getHeader(any(Short.class))).thenReturn(NakAckHeader2.createXmitRequestHeader(null));
     recorder.up(evt);
@@ -134,22 +138,28 @@ public class StatRecorderJUnitTest {
 
   static class MyStats extends DummyDMStats {
     public int ucastMessagesReceived;
+    public int ucastMessageBytesReceived;
     public int ucastMessagesSent;
+    public int ucastMessageBytesSent;
     public int ucastRetransmits;
     
     public int mcastMessagesReceived;
+    public int mcastMessageBytesReceived;
     public int mcastMessagesSent;
+    public int mcastMessageBytesSent;
     public int mcastRetransmits;
     public int mcastRetransmitRequests;
     
     @Override
     public void incUcastReadBytes(int i) {
-      ucastMessagesReceived += i;
+      ucastMessagesReceived++;
+      ucastMessageBytesReceived += i;
     }
     
     @Override
     public void incUcastWriteBytes(int i) {
-      ucastMessagesSent += i;
+      ucastMessagesSent++;
+      ucastMessageBytesSent += i;
     }
     
     @Override
@@ -159,12 +169,14 @@ public class StatRecorderJUnitTest {
 
     @Override
     public void incMcastReadBytes(int i) {
-      mcastMessagesReceived += i;
+      mcastMessagesReceived++;
+      mcastMessageBytesReceived += i;
     }
     
     @Override
     public void incMcastWriteBytes(int i) {
-      mcastMessagesSent += i;
+      mcastMessagesSent++;
+      mcastMessageBytesSent += i;
     }
     
     @Override


Mime
View raw message