ExtentQueue lru;
seastar::metrics::metric_group metrics;
+ // hit and miss indicates if an extent is linked when touching it
+ uint64_t hit = 0;
+ uint64_t miss = 0;
+
public:
ExtentPinboardLRU(std::size_t capacity) : lru(capacity) {
LOG_PREFIX(ExtentPinboardLRU::ExtentPinboardLRU);
},
sm::description("total extents pinned by the lru")
),
+ sm::make_counter(
+ "lru_hit", hit,
+ sm::description("total count of the extents that are linked to lru when touching them")
+ ),
+ sm::make_counter(
+ "lru_miss", miss,
+ sm::description("total count of the extents that are not linked to lru when touching them")
+ ),
}
);
}
extent_len_t /*load_length*/) final {
if (extent.is_linked_to_list()) {
lru.move_to_top(extent, p_src);
+ hit++;
} else {
lru.add_to_top(extent, p_src);
+ miss++;
}
}
// hot until it is evicted to the warm out queue and accessed once
// again.
}
+ hit++;
} else if (!is_logical_type(extent.get_type())) {
// put physical extents to hot queue directly
ceph_assert(state == extent_2q_state_t::Fresh);
auto trimmed_extents = hot.add_to_top(extent, p_src);
on_update_hot(trimmed_extents);
hit_queue(overall_hits.absent, p_src, type);
+ miss++;
} else { // the logical extent which is not in warm_in and not in hot
ceph_assert(state == extent_2q_state_t::Fresh);
auto lext = extent.cast<LogicalCachedExtent>();
hit_queue(overall_hits.sequential_absent, p_src, type);
}
}
+ miss++;
}
auto end = load_start + load_length;
assert(end != 0);
};
mutable hit_stats_t overall_hits;
mutable hit_stats_t last_hits;
+
+ // hit and miss indicates if an extent is linked when touching it
+ uint64_t hit = 0;
+ uint64_t miss = 0;
};
void ExtentPinboardTwoQ::get_stats(
},
sm::description("total extents pinned by the 2q hot queue")
),
+ sm::make_counter(
+ "2q_hit", hit,
+ sm::description("total count of the extents that are linked to 2Q when touching them")
+ ),
+ sm::make_counter(
+ "2q_miss", miss,
+ sm::description("total count of the extents that are not linked to 2Q when touching them")
+ ),
}
);
}