osd_plb.add_u64_counter(
l_osd_watch_timeouts, "watch_timeouts",
"Number of watches that timed out or were blocklisted",
- NULL, PerfCountersBuilder::PRIO_USEFUL);
+ nullptr, PerfCountersBuilder::PRIO_USEFUL);
+
+ // scrub I/O (no EC vs. replicated differentiation)
+ osd_plb.add_u64_counter(l_osd_scrub_omapgetheader_cnt, "scrub_omapgetheader_cnt", "scrub omap get header calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_omapgetheader_bytes, "scrub_omapgetheader_bytes", "scrub omap get header bytes read");
+ osd_plb.add_u64_counter(l_osd_scrub_omapget_cnt, "scrub_omapget_cnt", "scrub omap get calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_omapget_bytes, "scrub_omapget_bytes", "scrub omap get bytes read");
+ // scrub I/O performed for replicated pools
+ osd_plb.add_u64_counter(l_osd_scrub_rppool_getattr_cnt, "scrub_replicated_getattr_cnt", "scrub replicated pool getattr calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_rppool_stats_cnt, "scrub_replicated_stats_cnt", "scrub replicated pool stats calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_rppool_read_cnt, "scrub_replicated_read_cnt", "scrub replicated pool read calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_rppool_read_bytes, "scrub_replicated_read_bytes", "scrub replicated pool read bytes read");
+ // scrub I/O performed for EC pools
+ osd_plb.add_u64_counter(l_osd_scrub_ec_getattr_cnt, "scrub_ec_getattr_cnt", "scrub ec getattr calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_ec_stats_cnt, "scrub_ec_stats_cnt", "scrub ec stats calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_ec_read_cnt, "scrub_ec_read_cnt", "scrub ec read calls count");
+ osd_plb.add_u64_counter(l_osd_scrub_ec_read_bytes, "scrub_ec_read_bytes", "scrub ec read bytes read");
+
+ // scrub I/O performed for replicated pools
return osd_plb.create_perf_counters();
}
#include "common/perf_counters.h"
#include "common/perf_counters_key.h"
-enum {
+enum osd_counter_idx_t {
l_osd_first = 10000,
l_osd_op_wip,
l_osd_op,
l_osd_watch_timeouts,
+ // scrub I/O (no EC vs. replicated differentiation)
+ l_osd_scrub_omapgetheader_cnt, ///< omap get header calls count
+ l_osd_scrub_omapgetheader_bytes, ///< bytes read by omap get header
+ l_osd_scrub_omapget_cnt, ///< omap get calls count
+ l_osd_scrub_omapget_bytes, ///< total bytes read by omap get
+ // scrub I/O - replicated pools
+ l_osd_scrub_rppool_getattr_cnt, ///< get_attr calls count
+ l_osd_scrub_rppool_stats_cnt, ///< stats calls count
+ l_osd_scrub_rppool_read_cnt, ///< read calls count
+ l_osd_scrub_rppool_read_bytes, ///< total bytes read
+ // scrub I/O - EC
+ l_osd_scrub_ec_getattr_cnt, ///< get_attr calls count
+ l_osd_scrub_ec_stats_cnt, ///< stats calls count
+ l_osd_scrub_ec_read_cnt, ///< read calls count
+ l_osd_scrub_ec_read_bytes, ///< total bytes read
+
l_osd_last,
};
};
+// links to the two sets of I/O performance counters used by PgScrubber
+// (one to be used when in a replicated pool, and one for EC))
+static inline constexpr ScrubCounterSet io_counters_replicated{
+ .getattr_cnt = l_osd_scrub_rppool_getattr_cnt,
+ .stats_cnt = l_osd_scrub_rppool_stats_cnt,
+ .read_cnt = l_osd_scrub_rppool_read_cnt,
+ .read_bytes = l_osd_scrub_rppool_read_bytes,
+ .omapgetheader_cnt = l_osd_scrub_omapgetheader_cnt,
+ .omapgetheader_bytes = l_osd_scrub_omapgetheader_bytes,
+ .omapget_cnt = l_osd_scrub_omapget_cnt,
+ .omapget_bytes = l_osd_scrub_omapget_bytes
+};
+
+static inline constexpr ScrubCounterSet io_counters_ec{
+ .getattr_cnt = l_osd_scrub_ec_getattr_cnt,
+ .stats_cnt = l_osd_scrub_ec_stats_cnt,
+ .read_cnt = l_osd_scrub_ec_read_cnt,
+ .read_bytes = l_osd_scrub_ec_read_bytes,
+ .omapgetheader_cnt = l_osd_scrub_omapgetheader_cnt,
+ .omapgetheader_bytes = l_osd_scrub_omapgetheader_bytes,
+ .omapget_cnt = l_osd_scrub_omapget_cnt,
+ .omapget_bytes = l_osd_scrub_omapget_bytes
+};
} // namespace Scrub
#include "include/types.h"
#include "messages/MOSDScrubReserve.h"
#include "os/ObjectStore.h"
+#include "osd/osd_perf_counters.h" // for osd_counter_idx_t
#include "OpRequest.h"
virtual bool is_waiting_for_unreadable_object() const = 0;
};
+// defining a specific subset of performance counters. Each of the members
+// is set to (the index of) the corresponding performance counter.
+// Separate sets are used for replicated and erasure-coded pools.
+struct ScrubIoCounterSet {
+ osd_counter_idx_t getattr_cnt; ///< get_attr calls count
+ osd_counter_idx_t stats_cnt; ///< stats calls count
+ osd_counter_idx_t read_cnt; ///< read calls count
+ osd_counter_idx_t read_bytes; ///< total bytes read
+ osd_counter_idx_t omapgetheader_cnt; ///< omap get header calls count
+ osd_counter_idx_t omapgetheader_bytes; ///< bytes read by omap get header
+ osd_counter_idx_t omapget_cnt; ///< omap get calls count
+ osd_counter_idx_t omapget_bytes; ///< total bytes read by omap get
+};
} // namespace Scrub