[this] { return get_unavailable_unused_bytes(); },
sm::description("the size of the space is unavailable and not alive")),
+ sm::make_counter("dirty_journal_bytes",
+ [this] { return get_dirty_journal_size(); },
+ sm::description("the size of the journal for dirty extents")),
+ sm::make_counter("alloc_journal_bytes",
+ [this] { return get_alloc_journal_size(); },
+ sm::description("the size of the journal for alloc info")),
+
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,
(double)segments.get_total_bytes();
}
+ /*
+ * Journal sizes
+ */
+ std::size_t get_dirty_journal_size() const {
+ auto journal_head = segments.get_journal_head();
+ if (journal_head == JOURNAL_SEQ_NULL ||
+ dirty_extents_replay_from == JOURNAL_SEQ_NULL) {
+ return 0;
+ }
+ return (journal_head.segment_seq - dirty_extents_replay_from.segment_seq) *
+ segments.get_segment_size() +
+ journal_head.offset.as_seg_paddr().get_segment_off() -
+ segments.get_segment_size() -
+ dirty_extents_replay_from.offset.as_seg_paddr().get_segment_off();
+ }
+
+ std::size_t get_alloc_journal_size() const {
+ auto journal_head = segments.get_journal_head();
+ if (journal_head == JOURNAL_SEQ_NULL ||
+ alloc_info_replay_from == JOURNAL_SEQ_NULL) {
+ return 0;
+ }
+ return (journal_head.segment_seq - alloc_info_replay_from.segment_seq) *
+ segments.get_segment_size() +
+ journal_head.offset.as_seg_paddr().get_segment_off() -
+ segments.get_segment_size() -
+ alloc_info_replay_from.offset.as_seg_paddr().get_segment_off();
+ }
+
/**
* should_block_on_gc
*