sm::make_counter("unavailable_unused_bytes",
[this] { return get_unavailable_unused_bytes(); },
sm::description("the size of the space is unavailable and not alive")),
- 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_counter("accumulated_blocked_ios", stats.accumulated_blocked_ios,
- sm::description("accumulated total number of ios that were blocked by gc")),
- sm::make_counter("reclaim_rewrite_bytes", stats.reclaim_rewrite_bytes,
+ sm::make_counter("projected_count", stats.projected_count,
+ sm::description("the number of projected usage reservations")),
+ sm::make_counter("projected_used_bytes_sum", stats.projected_used_bytes_sum,
+ sm::description("the sum of the projected usage in bytes")),
+
+ sm::make_counter("io_count", stats.io_count,
+ sm::description("the sum of IOs")),
+ sm::make_counter("io_blocked_count", stats.io_blocked_count,
+ sm::description("IOs that are blocked by gc")),
+ sm::make_counter("io_blocked_sum", stats.io_blocked_sum,
+ sm::description("the sum of blocking IOs")),
+
+ sm::make_counter("reclaimed_bytes", stats.reclaimed_bytes,
+ sm::description("rewritten bytes due to reclaim")),
+ sm::make_counter("reclaimed_segment_bytes", stats.reclaimed_segment_bytes,
sm::description("rewritten bytes due to reclaim")),
- sm::make_counter("reclaiming_bytes", stats.reclaiming_bytes,
- sm::description("bytes being reclaimed")),
- sm::make_counter("ios_blocking", stats.ios_blocking,
- sm::description("IOs that are blocking on space usage")),
+
+ sm::make_gauge("available_ratio",
+ [this] { return segments.get_available_ratio(); },
+ sm::description("ratio of available space to total space")),
+ sm::make_gauge("reclaim_ratio",
+ [this] { return get_reclaim_ratio(); },
+ sm::description("ratio of reclaimable space to unavailable space")),
+
sm::make_histogram("segment_utilization_distribution",
[this]() -> seastar::metrics::histogram& {
return stats.segment_util;
auto d = seastar::lowres_system_clock::now() - start;
INFO("duration: {}, pavail_ratio before: {}, repeats: {}", d, pavail_ratio, runs);
if (final_reclaim()) {
- stats.reclaim_rewrite_bytes += stats.reclaiming_bytes;
+ stats.reclaimed_bytes += stats.reclaiming_bytes;
+ stats.reclaimed_segment_bytes += segments.get_segment_size();
stats.reclaiming_bytes = 0;
next_reclaim_pos.reset();
} else {
* Bytes occupied by live extents
*/
uint64_t used_bytes = 0;
+
/**
* projected_used_bytes
*
* Sum of projected bytes used by each transaction between throttle
- * acquisition and commit completion. See await_throttle()
+ * acquisition and commit completion. See reserve_projected_usage()
*/
uint64_t projected_used_bytes = 0;
+ uint64_t projected_count = 0;
+ uint64_t projected_used_bytes_sum = 0;
+
+ uint64_t io_blocking_num = 0;
+ uint64_t io_count = 0;
+ uint64_t io_blocked_count = 0;
+ uint64_t io_blocked_sum = 0;
- uint64_t accumulated_blocked_ios = 0;
- int64_t ios_blocking = 0;
- uint64_t reclaim_rewrite_bytes = 0;
uint64_t reclaiming_bytes = 0;
+ uint64_t reclaimed_bytes = 0;
+ uint64_t reclaimed_segment_bytes = 0;
+
seastar::metrics::histogram segment_util;
} stats;
seastar::metrics::metric_group metrics;
// The pipeline configuration prevents another IO from entering
// prepare until the prior one exits and clears this.
ceph_assert(!blocked_io_wake);
- stats.ios_blocking++;
+ bool is_blocked = false;
+ ++stats.io_count;
+ if (should_block_on_gc()) {
+ ++stats.io_blocking_num;
+ ++stats.io_blocked_count;
+ stats.io_blocked_sum += stats.io_blocking_num;
+ is_blocked = true;
+ }
return seastar::do_until(
[this] {
log_gc_state("await_hard_limits");
return !should_block_on_gc();
},
[this] {
- stats.accumulated_blocked_ios++;
blocked_io_wake = seastar::promise<>();
return blocked_io_wake->get_future();
}
- ).then([this, projected_usage] {
+ ).then([this, projected_usage, is_blocked] {
ceph_assert(!blocked_io_wake);
- assert(stats.ios_blocking > 0);
- stats.ios_blocking--;
stats.projected_used_bytes += projected_usage;
+ ++stats.projected_count;
+ stats.projected_used_bytes_sum += stats.projected_used_bytes;
+ if (is_blocked) {
+ assert(stats.io_blocking_num > 0);
+ --stats.io_blocking_num;
+ }
});
}