]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
osdc/Objecter: Add age to the ops
authorVarsha Rao <varao@redhat.com>
Thu, 22 Aug 2019 13:45:35 +0000 (19:15 +0530)
committerNathan Cutler <ncutler@suse.com>
Mon, 4 Nov 2019 18:25:41 +0000 (19:25 +0100)
Fixes: https://tracker.ceph.com/issues/40821
Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit ed7ebb198808ab8fb8f76c1663d514d406572fed)

src/osdc/Objecter.cc

index 9e2c610ee49d7cf8250848dad0206da50e4814cf..d90e28db98b7098673dcaae6a78c82ec91f2bb09 100644 (file)
@@ -4551,10 +4551,12 @@ void Objecter::_dump_ops(const OSDSession *s, Formatter *fmt)
        p != s->ops.end();
        ++p) {
     Op *op = p->second;
+    auto age = std::chrono::duration<double>(coarse_mono_clock::now() - op->stamp);
     fmt->open_object_section("op");
     fmt->dump_unsigned("tid", op->tid);
     op->target.dump(fmt);
     fmt->dump_stream("last_sent") << op->stamp;
+    fmt->dump_float("age", age.count());
     fmt->dump_int("attempts", op->attempts);
     fmt->dump_stream("snapid") << op->snapid;
     fmt->dump_stream("snap_context") << op->snapc;