From 29ed44564659d314930e410c711d2e4a73a2fb07 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Thu, 12 May 2022 21:28:05 +0800 Subject: [PATCH] crimson: replace DERIVE metrics with COUNTER metrics 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 --- src/crimson/admin/osd_admin.cc | 3 - src/crimson/os/seastore/segment_cleaner.cc | 78 +++++++++++----------- 2 files changed, 39 insertions(+), 42 deletions(-) diff --git a/src/crimson/admin/osd_admin.cc b/src/crimson/admin/osd_admin.cc index b29a5650565..79ca6e853d8 100644 --- a/src/crimson/admin/osd_admin.cc +++ b/src/crimson/admin/osd_admin.cc @@ -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(); diff --git a/src/crimson/os/seastore/segment_cleaner.cc b/src/crimson/os/seastore/segment_cleaner.cc index 1d0ed0a48f4..1a9784e36f3 100644 --- a/src/crimson/os/seastore/segment_cleaner.cc +++ b/src/crimson/os/seastore/segment_cleaner.cc @@ -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; -- 2.39.5