]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
src/tools/ceph-dedup-tool: fix counting total objects
authormyoungwon oh <omwmw@sk.com>
Thu, 27 Jun 2019 14:15:44 +0000 (23:15 +0900)
committermyoungwon oh <omwmw@sk.com>
Thu, 27 Jun 2019 14:15:44 +0000 (23:15 +0900)
Signed-off-by: Myoungwon Oh <omwmw@sk.com>
src/tools/ceph_dedup_tool.cc

index 56ba56ca69b858c619778dee1293f921758c5b8c..15d373c214688479db64cbffdf95b617418e9ac6 100644 (file)
@@ -233,7 +233,9 @@ static void print_dedup_estimate(bool debug = false)
   for (auto &et : estimate_threads) {
     total_size += et->get_total_bytes();
     examined_objects += et->get_examined_objects();
-    total_objects += et->get_total_objects();
+    if (!total_objects) {
+      total_objects = et->get_total_objects();
+    }
   }
 
   cout << " result: " << total_size << " | " << dedup_size << " (total size | deduped size) " << std::endl;
@@ -757,7 +759,9 @@ static void print_chunk_scrub()
   int fixed_objects = 0;
 
   for (auto &et : estimate_threads) {
-    total_objects += et->get_total_objects();
+    if (!total_objects) {
+      total_objects = et->get_total_objects();
+    }
     examined_objects += et->get_examined_objects();
     ChunkScrub *ptr = static_cast<ChunkScrub*>(et.get());
     fixed_objects += ptr->get_fixed_objects();