]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/os/seastore: add metrics about total invalidated transactions
authorZhang Song <zhangsong325@gmail.com>
Sun, 9 Jul 2023 04:22:58 +0000 (12:22 +0800)
committerMatan Breizman <mbreizma@redhat.com>
Wed, 11 Oct 2023 11:42:20 +0000 (11:42 +0000)
Signed-off-by: Zhang Song <zhangsong325@gmail.com>
(cherry picked from commit 6265452c50c2bbd0283a66d03d6a8538c2285293)

src/crimson/os/seastore/cache.cc
src/crimson/os/seastore/cache.h

index d6c9fdce3aa6381cedecacca5390bd9c3908face..088053248c248ebff20d179c5dcc4f7c1ddf9da7 100644 (file)
@@ -225,9 +225,9 @@ void Cache::register_metrics()
           "cache",
           {
             sm::make_counter(
-              "trans_invalidated",
+              "trans_invalidated_by_extent",
               counter,
-              sm::description("total number of transaction invalidated"),
+              sm::description("total number of transactions invalidated by extents"),
               {src_label, ext_label}
             ),
           }
@@ -295,6 +295,12 @@ void Cache::register_metrics()
       metrics.add_group(
         "cache",
         {
+          sm::make_counter(
+            "trans_invalidated",
+            efforts.total_trans_invalidated,
+            sm::description("total number of transactions invalidated"),
+            {src_label}
+          ),
           sm::make_counter(
             "invalidated_delta_bytes",
             efforts.mutate_delta_bytes,
@@ -843,6 +849,7 @@ void Cache::mark_transaction_conflicted(
 
   auto& efforts = get_by_src(stats.invalidated_efforts_by_src,
                              t.get_src());
+  ++efforts.total_trans_invalidated;
 
   auto& counter = get_by_ext(efforts.num_trans_invalidated,
                              conflicting_extent.get_type());
index 9289dda0881b579a35fffd9c5f0a10aba3591a4f..cb6ad27317d6ca62a5a0a806ed708514bf1e374f 100644 (file)
@@ -1342,6 +1342,7 @@ private:
     io_stat_t fresh;
     io_stat_t fresh_ool_written;
     counter_by_extent_t<uint64_t> num_trans_invalidated;
+    uint64_t total_trans_invalidated = 0;
     uint64_t num_ool_records = 0;
     uint64_t ool_record_bytes = 0;
   };