MB-20725: Reset drift stats 22/69422/3
authorJim Walker <jim@couchbase.com>
Wed, 2 Nov 2016 16:00:56 +0000 (16:00 +0000)
committerDave Rigby <daver@couchbase.com>
Thu, 3 Nov 2016 12:52:56 +0000 (12:52 +0000)
When resetting stats, include the drift counters.

Change-Id: I5c0b78a9d885ed6970f219c2089bf34df3da2425
Reviewed-on: http://review.couchbase.org/69422
Reviewed-by: Dave Rigby <daver@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/hlc.h
src/vbucket.cc

index 29b256c..a1d2695 100644 (file)
--- a/src/hlc.h
+++ b/src/hlc.h
@@ -145,6 +145,15 @@ public:
         add_prefixed_stat(prefix.data(), "logical_clock_ticks", logicalClockTicks.load(), add_stat, c);
     }
 
+    void resetStats() {
+        // Don't clear max_cas or the threshold values.
+        cummulativeDrift = 0;
+        cummulativeDriftIncrements = 0;
+        driftAheadExceeded = 0;
+        driftBehindExceeded = 0;
+        logicalClockTicks = 0;
+    }
+
 private:
     /*
      * Returns 48-bit of t (bottom 16-bit zero)
index 9d57416..b12d5ba 100644 (file)
@@ -272,6 +272,8 @@ void VBucket::resetStats() {
     dirtyQueueDrain.store(0);
     fileSpaceUsed = 0;
     fileSize = 0;
+
+    hlc.resetStats();
 }
 
 template <typename T>