]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/mon_types.h: allow testing encode/decode of LevelDBStoreStats
authorJoao Eduardo Luis <joao@redhat.com>
Mon, 26 Jan 2015 12:59:21 +0000 (12:59 +0000)
committerJoao Eduardo Luis <jecluis@gmail.com>
Sun, 1 Mar 2015 10:11:24 +0000 (10:11 +0000)
Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/mon/mon_types.h

index f28e5e60816a3f704b12bc6e975e4944d1c2f59d..d7346cf2de43834cf964d43fb659b69875034c59 100644 (file)
@@ -91,6 +91,16 @@ struct LevelDBStoreStats {
     ::decode(last_update, p);
     DECODE_FINISH(p);
   }
+
+  static void generate_test_instances(list<LevelDBStoreStats*>& ls) {
+    ls.push_back(new LevelDBStoreStats);
+    ls.push_back(new LevelDBStoreStats);
+    ls.back()->bytes_total = 1024*1024;
+    ls.back()->bytes_sst = 512*1024;
+    ls.back()->bytes_log = 256*1024;
+    ls.back()->bytes_misc = 256*1024;
+    ls.back()->last_update = utime_t();
+  }
 };
 WRITE_CLASS_ENCODER(LevelDBStoreStats)