]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
objecter: add op latency stat and in-flight count 46458/head
authoryuval Lifshitz <ylifshit@redhat.com>
Tue, 31 May 2022 15:40:30 +0000 (18:40 +0300)
committeryuval Lifshitz <ylifshit@redhat.com>
Tue, 7 Jun 2022 12:44:54 +0000 (15:44 +0300)
this is done in order to better estimate the origin of the end-to-end
operation latency. and see how much of it is due to the objecter and how
much of it is due to the client that uses it (e.g. the RGW)

Signed-off-by: yuval Lifshitz <ylifshit@redhat.com>
src/osdc/Objecter.cc

index 708c12cc9e6ec631ed4e26fdbe7cda06ad33e538..4fe1b3a41c3aa4448b2ea4c925c2a06e2c7dd8bb 100644 (file)
@@ -109,6 +109,8 @@ enum {
   l_osdc_op_send_bytes,
   l_osdc_op_resend,
   l_osdc_op_reply,
+  l_osdc_op_latency,
+  l_osdc_op_inflight,
   l_osdc_oplen_avg,
 
   l_osdc_op,
@@ -261,6 +263,8 @@ void Objecter::init()
     pcb.add_u64_counter(l_osdc_op_send_bytes, "op_send_bytes", "Sent data", NULL, 0, unit_t(UNIT_BYTES));
     pcb.add_u64_counter(l_osdc_op_resend, "op_resend", "Resent operations");
     pcb.add_u64_counter(l_osdc_op_reply, "op_reply", "Operation reply");
+    pcb.add_time_avg(l_osdc_op_latency, "op_latency", "Operation latency");
+    pcb.add_u64(l_osdc_op_inflight, "op_inflight", "Operations in flight");
     pcb.add_u64_avg(l_osdc_oplen_avg, "oplen_avg", "Average length of operation vector");
 
     pcb.add_u64_counter(l_osdc_op, "op", "Operations");
@@ -3562,6 +3566,8 @@ void Objecter::handle_osd_op_reply(MOSDOpReply *m)
     op->onfinish = nullptr;
   }
   logger->inc(l_osdc_op_reply);
+  logger->tinc(l_osdc_op_latency, ceph::coarse_mono_time::clock::now() - op->stamp);
+  logger->set(l_osdc_op_inflight, num_in_flight);
 
   /* get it before we call _finish_op() */
   auto completion_lock = s->get_lock(op->target.base_oid);