]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: s3 DeleteObjects api increments delete op counters 69583/head
authorCasey Bodley <cbodley@redhat.com>
Thu, 18 Jun 2026 15:29:39 +0000 (11:29 -0400)
committerCasey Bodley <cbodley@redhat.com>
Thu, 25 Jun 2026 14:35:22 +0000 (10:35 -0400)
rgw tracks perf counters for delete ops, but they didn't cover the
multi-delete api. each call to `handle_individual_object()` now
emits the same metrics as a call to the s3 DeleteObject api

Fixes: https://tracker.ceph.com/issues/77505
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_op.cc

index bfcb0ea6df1f0647d5b944fbcc47b0099e2ee55f..64991b75baa6761303091702ef634de16ba05f41 100644 (file)
@@ -8179,6 +8179,9 @@ void RGWDeleteMultiObj::handle_individual_object(const RGWMultiDelObject& object
   } prefix{*this, o};
   const DoutPrefixProvider* dpp = &prefix;
 
+  using Clock = ceph::coarse_real_clock;
+  const auto started_at = Clock::now();
+
   std::unique_ptr<rgw::sal::Object> obj = bucket->get_object(o);
   if (o.empty()) {
     send_partial_response(o, false, "", -EINVAL);
@@ -8275,6 +8278,11 @@ void RGWDeleteMultiObj::handle_individual_object(const RGWMultiDelObject& object
   }
   
   send_partial_response(o, del_op->result.delete_marker, del_op->result.version_id, r);
+
+  auto counters = rgw::op_counters::get(s);
+  rgw::op_counters::inc(counters, l_rgw_op_del_obj, 1);
+  rgw::op_counters::inc(counters, l_rgw_op_del_obj_b, obj_size);
+  rgw::op_counters::tinc(counters, l_rgw_op_del_obj_lat, Clock::now() - started_at);
 }
 
 void RGWDeleteMultiObj::handle_objects(const std::vector<RGWMultiDelObject>& objects,