]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: MonOpRequest: add dump function
authorJoao Eduardo Luis <joao@suse.de>
Thu, 18 Jun 2015 00:35:02 +0000 (01:35 +0100)
committerJoao Eduardo Luis <joao@suse.de>
Thu, 16 Jul 2015 17:03:39 +0000 (18:03 +0100)
Signed-off-by: Joao Eduardo Luis <joao@suse.de>
src/mon/MonOpRequest.h

index 3dece4f43c3378bd3d2c1be3a84555fbdfe25096..b024ca4d600c42fee01cd3a36f92ba1b56922566 100644 (file)
@@ -4,6 +4,7 @@
  * Ceph - scalable distributed file system
  *
  * Copyright (C) 2015 Red Hat <contact@redhat.com>
+ * Copyright (C) 2015 SUSE LINUX GmbH
  *
  * This is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Lesser General Public
@@ -95,6 +96,27 @@ public:
   typedef ceph::shared_ptr<MonOpRequest> Ref;
 
   void send_reply(Message *reply);
+
+  void _dump(utime_t now, Formatter *f) const {
+    {
+      f->open_array_section("events");
+      Mutex::Locker l(lock);
+      for (list<pair<utime_t,string> >::const_iterator i = events.begin();
+           i != events.end(); ++i) {
+        f->open_object_section("event");
+        f->dump_stream("time") << i->first;
+        f->dump_string("event", i->second);
+        f->close_section();
+      }
+      f->close_section();
+      f->open_object_section("info");
+      f->dump_int("seq", seq);
+      f->dump_bool("src_is_mon", is_src_mon());
+      f->dump_stream("source") << request->get_source_inst();
+      f->close_section();
+    }
+  }
+
 };
 
 typedef MonOpRequest::Ref MonOpRequestRef;