{
segment_cleaner->set_extent_callback(this);
journal->set_write_pipeline(&write_pipeline);
- register_metrics();
}
TransactionManager::mkfs_ertr::future<> TransactionManager::mkfs()
t,
*ref);
cache->retire_extent(t, ref);
- stats.extents_retired_total++;
- stats.extents_retired_bytes += ref->get_length();
}
return ret.refcount;
});
DEBUGT("offset {} refcount 0", t, offset);
return cache->retire_extent_addr(
t, result.addr, result.length
- ).si_then([result, this] {
- stats.extents_retired_total++;
- stats.extents_retired_bytes += result.length;
+ ).si_then([] {
return ref_ret(
interruptible::ready_future_marker{},
0);
TransactionManager::~TransactionManager() {}
-void TransactionManager::register_metrics()
-{
- namespace sm = seastar::metrics;
- metrics.add_group("tm", {
- sm::make_counter("extents_retired_total", stats.extents_retired_total,
- sm::description("total number of retired extents in TransactionManager")),
- sm::make_counter("extents_retired_bytes", stats.extents_retired_bytes,
- sm::description("total size of retired extents in TransactionManager")),
- sm::make_counter("extents_mutated_total", stats.extents_mutated_total,
- sm::description("total number of mutated extents in TransactionManager")),
- sm::make_counter("extents_mutated_bytes", stats.extents_mutated_bytes,
- sm::description("total size of mutated extents in TransactionManager")),
- sm::make_counter("extents_allocated_total", stats.extents_allocated_total,
- sm::description("total number of allocated extents in TransactionManager")),
- sm::make_counter("extents_allocated_bytes", stats.extents_allocated_bytes,
- sm::description("total size of allocated extents in TransactionManager")),
- });
-}
-
}
auto ret = cache->duplicate_for_write(
t,
ref)->cast<LogicalCachedExtent>();
- stats.extents_mutated_total++;
- stats.extents_mutated_bytes += ret->get_length();
if (!ret->has_pin()) {
SUBDEBUGT(seastore_tm,
"duplicating {} for write: {}",
laddr_hint,
len,
ext->get_paddr()
- ).si_then([ext=std::move(ext), len, laddr_hint, &t, this](auto &&ref) mutable {
+ ).si_then([ext=std::move(ext), laddr_hint, &t](auto &&ref) mutable {
LOG_PREFIX(TransactionManager::alloc_extent);
ext->set_pin(std::move(ref));
- stats.extents_allocated_total++;
- stats.extents_allocated_bytes += len;
SUBDEBUGT(seastore_tm, "new extent: {}, laddr_hint: {}", t, *ext, laddr_hint);
return alloc_extent_iertr::make_ready_future<TCachedExtentRef<T>>(
std::move(ext));
WritePipeline write_pipeline;
- struct {
- uint64_t extents_retired_total = 0;
- uint64_t extents_retired_bytes = 0;
- uint64_t extents_mutated_total = 0;
- uint64_t extents_mutated_bytes = 0;
- uint64_t extents_allocated_total = 0;
- uint64_t extents_allocated_bytes = 0;
- } stats;
- seastar::metrics::metric_group metrics;
- void register_metrics();
-
rewrite_extent_ret rewrite_logical_extent(
Transaction& t,
LogicalCachedExtentRef extent);