]> git-server-git.apps.pok.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)
committerPatrick Donnelly <pdonnell@redhat.com>
Fri, 14 Feb 2020 18:09:03 +0000 (10:09 -0800)
Fixes: https://tracker.ceph.com/issues/40821
Signed-off-by: Varsha Rao <varao@redhat.com>
(cherry picked from commit ed7ebb198808ab8fb8f76c1663d514d406572fed)

Conflicts:
        src/osdc/Objecter.cc: changed coarse_mono_clock to mono_clock to
                              make types compatible.

src/osdc/Objecter.cc

index ca4a10046af70e7df15332252801fc46cbaf33dc..f16567c7fc29993cc2a780e02233f71ad1162222 100644 (file)
@@ -4538,10 +4538,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>(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;