MB-16836: Reset the stat 'ep_bg_fetched' to 0 on 'cbstats reset' command 29/57129/2
authorManu Dhundi <manu@couchbase.com>
Tue, 17 Nov 2015 22:55:18 +0000 (14:55 -0800)
committerManu Dhundi <manu@couchbase.com>
Tue, 17 Nov 2015 23:16:35 +0000 (23:16 +0000)
Change-Id: I444bd6c76265788d4366061d4d2b25e3c5e60518
Reviewed-on: http://review.couchbase.org/57129
Reviewed-by: abhinav dangeti <abhinav@couchbase.com>
Tested-by: buildbot <build@couchbase.com>
src/stats.h
tests/ep_testsuite.cc

index ad6413c..c35b757 100644 (file)
@@ -542,6 +542,7 @@ public:
         io_num_write.store(0);
         io_read_bytes.store(0);
         io_write_bytes.store(0);
+        bg_fetched.store(0);
         bgNumOperations.store(0);
         bgWait.store(0);
         bgLoad.store(0);
index 007f3da..d1af357 100644 (file)
@@ -6538,6 +6538,9 @@ static enum test_result test_bg_stats(ENGINE_HANDLE *h, ENGINE_HANDLE_V1 *h1) {
     check(get_int_stat(h, h1, "ep_bg_num_samples") == 2,
           "Expected one sample");
 
+    h1->reset_stats(h, NULL);
+    checkeq(0, get_int_stat(h, h1, "ep_bg_fetched"),
+            "ep_bg_fetched is not reset to 0");
     return SUCCESS;
 }