Skip to content

Commit 16cf250

Browse files
committed
osd/scrub: turning additional counters into unlabeled
i.e. - moving counters from the 'scrbcnt_' enums into the ScrubCounterSet object. Signed-off-by: Ronen Friedman <[email protected]>
1 parent 2fec38b commit 16cf250

File tree

5 files changed

+46
-26
lines changed

5 files changed

+46
-26
lines changed

src/osd/osd_perf_counters.cc

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -376,9 +376,20 @@ PerfCounters *build_osd_logger(CephContext *cct) {
376376

377377
// scrub (no EC vs. replicated differentiation)
378378
// scrub - replicated pools
379-
osd_plb.add_u64_counter(l_osd_scrub_rppool_active_started, "num_scrubs_past_reservation_replicated", "scrubs count replicated");
379+
osd_plb.add_u64_counter(l_osd_scrub_rppool_started, "num_scrubs_started_replicated", "replicated scrubs attempted count");
380+
osd_plb.add_u64_counter(l_osd_scrub_rppool_active_started, "num_scrubs_past_reservation_replicated", "replicated scrubs count");
381+
osd_plb.add_u64_counter(l_osd_scrub_rppool_successful, "successful_scrubs_replicated", "successful replicated scrubs count");
382+
osd_plb.add_time_avg(l_osd_scrub_rppool_successful_elapsed, "successful_scrubs_replicated_elapsed", "time to complete a successful replicated scrub");
383+
osd_plb.add_u64_counter(l_osd_scrub_rppool_failed, "failed_scrubs_replicated", "failed replicated scrubs count");
384+
osd_plb.add_time_avg(l_osd_scrub_rppool_failed_elapsed, "failed_scrubs_replicated_elapsed", "time to scrub failure replicated");
385+
380386
// scrub - EC
387+
osd_plb.add_u64_counter(l_osd_scrub_ec_started, "num_scrubs_started_ec", "scrubs attempted count ec");
381388
osd_plb.add_u64_counter(l_osd_scrub_ec_active_started, "num_scrubs_past_reservation_ec", "scrubs count ec");
389+
osd_plb.add_u64_counter(l_osd_scrub_ec_successful, "successful_scrubs_ec", "successful scrubs count ec");
390+
osd_plb.add_time_avg(l_osd_scrub_ec_successful_elapsed, "successful_scrubs_ec_elapsed", "time to complete a successful ec scrub");
391+
osd_plb.add_u64_counter(l_osd_scrub_ec_failed, "failed_scrubs_ec", "failed scrubs count ec");
392+
osd_plb.add_time_avg(l_osd_scrub_ec_failed_elapsed, "failed_scrubs_ec_elapsed", "time to scrub failure ec");
382393

383394
return osd_plb.create_perf_counters();
384395
}
@@ -431,12 +442,6 @@ PerfCounters *build_scrub_labeled_perf(CephContext *cct, std::string label)
431442

432443
scrub_perf.set_prio_default(PerfCountersBuilder::PRIO_INTERESTING);
433444

434-
scrub_perf.add_u64_counter(scrbcnt_started, "num_scrubs_started", "scrubs attempted count");
435-
scrub_perf.add_u64_counter(scrbcnt_failed, "failed_scrubs", "failed scrubs count");
436-
scrub_perf.add_u64_counter(scrbcnt_successful, "successful_scrubs", "successful scrubs count");
437-
scrub_perf.add_time_avg(scrbcnt_failed_elapsed, "failed_scrubs_elapsed", "time to scrub failure");
438-
scrub_perf.add_time_avg(scrbcnt_successful_elapsed, "successful_scrubs_elapsed", "time to scrub completion");
439-
440445
scrub_perf.add_u64_counter(scrbcnt_preempted, "preemptions", "preemptions on scrubs");
441446
scrub_perf.add_u64_counter(scrbcnt_chunks_selected, "chunk_selected", "chunk selection during scrubs");
442447
scrub_perf.add_u64_counter(scrbcnt_chunks_busy, "chunk_busy", "chunk busy during scrubs");

src/osd/osd_perf_counters.h

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -148,22 +148,34 @@ enum osd_counter_idx_t {
148148
l_osd_scrub_omapgetheader_bytes, ///< bytes read by omap get header
149149
l_osd_scrub_omapget_cnt, ///< omap get calls count
150150
l_osd_scrub_omapget_bytes, ///< total bytes read by omap get
151-
// scrub I/O - replicated pools
151+
152+
// ---- scrub I/O - replicated pools
152153
l_osd_scrub_rppool_getattr_cnt, ///< get_attr calls count
153154
l_osd_scrub_rppool_stats_cnt, ///< stats calls count
154155
l_osd_scrub_rppool_read_cnt, ///< read calls count
155156
l_osd_scrub_rppool_read_bytes, ///< total bytes read
156-
// scrub I/O - EC
157+
158+
// ---- scrub I/O - EC
157159
l_osd_scrub_ec_getattr_cnt, ///< get_attr calls count
158160
l_osd_scrub_ec_stats_cnt, ///< stats calls count
159161
l_osd_scrub_ec_read_cnt, ///< read calls count
160162
l_osd_scrub_ec_read_bytes, ///< total bytes read
161163

162-
// scrub (no EC vs. replicated differentiation)
163-
// scrub - replicated pools
164+
// ---- scrub - replicated pools
165+
l_osd_scrub_rppool_started, ///< scrubs that got started
164166
l_osd_scrub_rppool_active_started, ///< scrubs that got past replicas reservation
167+
l_osd_scrub_rppool_successful, ///< successful scrubs count
168+
l_osd_scrub_rppool_successful_elapsed, ///< time to complete a successful scrub
169+
l_osd_scrub_rppool_failed, ///< failed scrubs count
170+
l_osd_scrub_rppool_failed_elapsed, ///< time from start to failure
171+
165172
// scrub - EC
173+
l_osd_scrub_ec_started, ///< scrubs that got started
166174
l_osd_scrub_ec_active_started, /// scrubs that got past secondaries reservation
175+
l_osd_scrub_ec_successful, ///< successful scrubs count
176+
l_osd_scrub_ec_successful_elapsed, ///< time to complete a successful scrub
177+
l_osd_scrub_ec_failed, ///< failed scrubs count
178+
l_osd_scrub_ec_failed_elapsed, ///< time from start to failure
167179

168180
l_osd_last,
169181
};
@@ -214,18 +226,6 @@ PerfCounters *build_recoverystate_perf(CephContext *cct);
214226
enum {
215227
scrbcnt_first = 20500,
216228

217-
// -- basic statistics --
218-
/// The number of times we started a scrub
219-
scrbcnt_started,
220-
/// # successful scrubs
221-
scrbcnt_successful,
222-
/// time to complete a successful scrub
223-
scrbcnt_successful_elapsed,
224-
/// # failed scrubs
225-
scrbcnt_failed,
226-
/// time for a scrub to fail
227-
scrbcnt_failed_elapsed,
228-
229229
// -- interruptions of various types
230230
/// # preemptions
231231
scrbcnt_preempted,

src/osd/scrubber/pg_scrubber.h

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,12 @@ static inline constexpr ScrubCounterSet io_counters_replicated{
144144
.omapgetheader_bytes = l_osd_scrub_omapgetheader_bytes,
145145
.omapget_cnt = l_osd_scrub_omapget_cnt,
146146
.omapget_bytes = l_osd_scrub_omapget_bytes,
147-
.active_started_cnt = l_osd_scrub_rppool_active_started
147+
.started_cnt = l_osd_scrub_rppool_started,
148+
.active_started_cnt = l_osd_scrub_rppool_active_started,
149+
.successful_cnt = l_osd_scrub_rppool_successful,
150+
.successful_elapsed = l_osd_scrub_rppool_successful_elapsed,
151+
.failed_cnt = l_osd_scrub_rppool_failed,
152+
.failed_elapsed = l_osd_scrub_rppool_failed_elapsed
148153
};
149154

150155
static inline constexpr ScrubCounterSet io_counters_ec{
@@ -156,7 +161,12 @@ static inline constexpr ScrubCounterSet io_counters_ec{
156161
.omapgetheader_bytes = l_osd_scrub_omapgetheader_bytes,
157162
.omapget_cnt = l_osd_scrub_omapget_cnt,
158163
.omapget_bytes = l_osd_scrub_omapget_bytes,
159-
.active_started_cnt = l_osd_scrub_ec_active_started
164+
.started_cnt = l_osd_scrub_ec_started,
165+
.active_started_cnt = l_osd_scrub_ec_active_started,
166+
.successful_cnt = l_osd_scrub_ec_successful,
167+
.successful_elapsed = l_osd_scrub_ec_successful_elapsed,
168+
.failed_cnt = l_osd_scrub_ec_failed,
169+
.failed_elapsed = l_osd_scrub_ec_failed_elapsed
160170
};
161171
} // namespace Scrub
162172

src/osd/scrubber/scrub_machine.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ Session::Session(my_context ctx)
199199
m_perf_set = scrbr->get_labeled_counters();
200200
m_osd_counters = scrbr->get_osd_perf_counters();
201201
m_counters_idx = &scrbr->get_unlabeled_counters();
202-
m_perf_set->inc(scrbcnt_started);
202+
m_osd_counters->inc(m_counters_idx->started_cnt);
203203
}
204204

205205
Session::~Session()

src/osd/scrubber_common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,12 @@ struct ScrubCounterSet {
301301
osd_counter_idx_t omapgetheader_bytes; ///< bytes read by omap get header
302302
osd_counter_idx_t omapget_cnt; ///< omap get calls count
303303
osd_counter_idx_t omapget_bytes; ///< total bytes read by omap get
304+
osd_counter_idx_t started_cnt; ///< the number of times we started a scrub
304305
osd_counter_idx_t active_started_cnt; ///< scrubs that got past reservation
306+
osd_counter_idx_t successful_cnt; ///< successful scrubs count
307+
osd_counter_idx_t successful_elapsed; ///< time to complete a successful scrub
308+
osd_counter_idx_t failed_cnt; ///< failed scrubs count
309+
osd_counter_idx_t failed_elapsed; ///< time from start to failure
305310
};
306311

307312
} // namespace Scrub

0 commit comments

Comments
 (0)