]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson: replace DERIVE metrics with COUNTER metrics
authorKefu Chai <tchaikov@gmail.com>
Thu, 12 May 2022 13:28:05 +0000 (21:28 +0800)
committerKefu Chai <tchaikov@gmail.com>
Thu, 12 May 2022 13:30:50 +0000 (21:30 +0800)
in a recent change in Seastar, DERIVE metric was dropped in favor
of COUNTER.

in this change, all DERIVE metrics are replaced with COUNTER metrics.

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/crimson/admin/osd_admin.cc
src/crimson/os/seastore/segment_cleaner.cc

index b29a56505655993b9f7392f25e61915b3b46a916..79ca6e853d82142a99f082366c13128473a867b9 100644 (file)
@@ -248,9 +248,6 @@ private:
     case data_type::COUNTER:
       f->dump_unsigned(value_name, v.ui());
       break;
-    case data_type::DERIVE:
-      f->dump_int(value_name, v.i());
-      break;
     case data_type::HISTOGRAM: {
       f->open_object_section(value_name);
       auto&& h = v.get_histogram();
index 1d0ed0a48f417147548b6ff695f8ce691dc2181b..1a9784e36f3fdb6d6726a8c8c1419d6e54cdbf18 100644 (file)
@@ -402,39 +402,39 @@ void SegmentCleaner::register_metrics()
     }
   }
   metrics.add_group("segment_cleaner", {
-    sm::make_derive("segments_number",
-                   [this] { return segments.get_num_segments(); },
-                   sm::description("the number of segments")),
-    sm::make_derive("segment_size",
-                   [this] { return segments.get_segment_size(); },
-                   sm::description("the bytes of a segment")),
-    sm::make_derive("segments_in_journal",
-                   [this] { return segments.get_num_in_journal(); },
-                   sm::description("the number of segments in journal")),
-    sm::make_derive("segments_open",
-                   [this] { return segments.get_num_open(); },
-                   sm::description("the number of open segments")),
-    sm::make_derive("segments_empty",
-                   [this] { return segments.get_num_empty(); },
-                   sm::description("the number of empty segments")),
-    sm::make_derive("segments_closed",
-                   [this] { return segments.get_num_closed(); },
-                   sm::description("the number of closed segments")),
-    sm::make_derive("segments_count_open",
-                   [this] { return segments.get_count_open(); },
-                   sm::description("the count of open segment operations")),
-    sm::make_derive("segments_count_release",
-                   [this] { return segments.get_count_release(); },
-                   sm::description("the count of release segment operations")),
-    sm::make_derive("segments_count_close",
-                   [this] { return segments.get_count_close(); },
-                   sm::description("the count of close segment operations")),
-    sm::make_derive("total_bytes",
-                   [this] { return segments.get_total_bytes(); },
-                   sm::description("the size of the space")),
-    sm::make_derive("available_bytes",
-                   [this] { return segments.get_available_bytes(); },
-                   sm::description("the size of the space is available")),
+    sm::make_counter("segments_number",
+                    [this] { return segments.get_num_segments(); },
+                    sm::description("the number of segments")),
+    sm::make_counter("segment_size",
+                    [this] { return segments.get_segment_size(); },
+                    sm::description("the bytes of a segment")),
+    sm::make_counter("segments_in_journal",
+                    [this] { return segments.get_num_in_journal(); },
+                    sm::description("the number of segments in journal")),
+    sm::make_counter("segments_open",
+                    [this] { return segments.get_num_open(); },
+                    sm::description("the number of open segments")),
+    sm::make_counter("segments_empty",
+                    [this] { return segments.get_num_empty(); },
+                    sm::description("the number of empty segments")),
+    sm::make_counter("segments_closed",
+                    [this] { return segments.get_num_closed(); },
+                    sm::description("the number of closed segments")),
+    sm::make_counter("segments_count_open",
+                    [this] { return segments.get_count_open(); },
+                    sm::description("the count of open segment operations")),
+    sm::make_counter("segments_count_release",
+                    [this] { return segments.get_count_release(); },
+                    sm::description("the count of release segment operations")),
+    sm::make_counter("segments_count_close",
+                    [this] { return segments.get_count_close(); },
+                    sm::description("the count of close segment operations")),
+    sm::make_counter("total_bytes",
+                    [this] { return segments.get_total_bytes(); },
+                    sm::description("the size of the space")),
+    sm::make_counter("available_bytes",
+                    [this] { return segments.get_available_bytes(); },
+                    sm::description("the size of the space is available")),
 
     sm::make_counter("accumulated_blocked_ios", stats.accumulated_blocked_ios,
                     sm::description("accumulated total number of ios that were blocked by gc")),
@@ -442,12 +442,12 @@ void SegmentCleaner::register_metrics()
                     sm::description("rewritten bytes due to reclaim")),
     sm::make_counter("reclaiming_bytes", stats.reclaiming_bytes,
                     sm::description("bytes being reclaimed")),
-    sm::make_derive("ios_blocking", stats.ios_blocking,
-                   sm::description("IOs that are blocking on space usage")),
-    sm::make_derive("used_bytes", stats.used_bytes,
-                   sm::description("the size of the space occupied by live extents")),
-    sm::make_derive("projected_used_bytes", stats.projected_used_bytes,
-                   sm::description("the size of the space going to be occupied by new extents")),
+    sm::make_counter("ios_blocking", stats.ios_blocking,
+                    sm::description("IOs that are blocking on space usage")),
+    sm::make_counter("used_bytes", stats.used_bytes,
+                    sm::description("the size of the space occupied by live extents")),
+    sm::make_counter("projected_used_bytes", stats.projected_used_bytes,
+                    sm::description("the size of the space going to be occupied by new extents")),
     sm::make_histogram("segment_utilization_distribution",
                       [this]() -> seastar::metrics::histogram& {
                         return stats.segment_util;