]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/osd: track start and completion of ClientRequest
authorRadosław Zarzyński <rzarzyns@redhat.com>
Mon, 11 Apr 2022 14:46:07 +0000 (16:46 +0200)
committerRadosław Zarzyński <rzarzyns@redhat.com>
Thu, 5 May 2022 02:06:31 +0000 (04:06 +0200)
Signed-off-by: Radosław Zarzyński <rzarzyns@redhat.com>
src/crimson/osd/osd_operation.h
src/crimson/osd/osd_operation_external_tracking.h
src/crimson/osd/osd_operations/client_request.cc
src/crimson/osd/osd_operations/client_request.h

index 8a0ee05856df6f806132104f14488d0154c011d4..6f6c8b04f14495d8daa681b84a776180064f1665 100644 (file)
@@ -148,6 +148,9 @@ class TrackableOperationT : public OperationT<T> {
 protected:
   using OperationT<T>::OperationT;
 
+  struct StartEvent : TimeEvent<StartEvent> {};
+  struct CompletionEvent : TimeEvent<CompletionEvent> {};
+
   template <class EventT, class... Args>
   void track_event(Args&&... args) {
     // the idea is to have a visitor-like interface that allows to double
index 9a2f88b783db9dd7d14f72cdc79a550d5ea26c37..eaccd501a09ce8732ccf4e477181103812a895a5 100644 (file)
@@ -14,9 +14,14 @@ namespace crimson::osd {
 
 // Just the boilerplate currently. Implementing
 struct LttngBackend
-  : ClientRequest::ConnectionPipeline::AwaitMap::BlockingEvent::Backend,
-    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent::Backend
+  : ClientRequest::StartEvent::Backend,
+    ClientRequest::ConnectionPipeline::AwaitMap::BlockingEvent::Backend,
+    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent::Backend,
+    ClientRequest::CompletionEvent::Backend
 {
+  void handle(ClientRequest::StartEvent&,
+              const Operation&) override {}
+
   void handle(ClientRequest::ConnectionPipeline::AwaitMap::BlockingEvent& ev,
               const Operation& op,
               const ClientRequest::ConnectionPipeline::AwaitMap& blocker) override {
@@ -26,6 +31,9 @@ struct LttngBackend
               const Operation&,
               const OSD_OSDMapGate::OSDMapBlocker&) override {
   }
+
+  void handle(ClientRequest::CompletionEvent&,
+              const Operation&) override {}
 };
 
 } // namespace crimson::osd
index 532a1567de7d345b95c6f2ee1c332c70c0aca355..626b82c48406a54f7f72bc0b90bb9d987eeb33ec 100644 (file)
@@ -78,6 +78,7 @@ seastar::future<> ClientRequest::start()
 {
   logger().debug("{}: start", *this);
 
+  track_event<StartEvent>();
   return seastar::repeat([this, opref=IRef{this}]() mutable {
       logger().debug("{}: in repeat", *this);
       return enter_stage(cp().await_map).then([this]() {
@@ -146,6 +147,8 @@ seastar::future<> ClientRequest::start()
           }
        }, pgref);
       });
+    }).then([this] {
+      track_event<CompletionEvent>();
     });
 }
 
index c776c89d4c00a89f8329a50d07eb994974800b17..f0fbf4f88aa77b02ad7744283d78dc8f39df61b5 100644 (file)
@@ -106,9 +106,14 @@ private:
 
 public:
   std::tuple<
+    StartEvent,
     ConnectionPipeline::AwaitMap::BlockingEvent,
-    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent
+    OSD_OSDMapGate::OSDMapBlocker::BlockingEvent,
+    CompletionEvent
   > tracking_events;
+
+  friend class LttngBackend;
+  friend class HistoricBackend;
 };
 
 }