db/batchlog_manager: make structs stats public

Need to rename stats() -> get_stats() because it shadows the now
exported type name.
This commit is contained in:
Botond Dénes
2026-01-29 14:17:07 +02:00
parent f8bfaedb6e
commit ca2bbbad97
2 changed files with 8 additions and 5 deletions

View File

@@ -55,6 +55,11 @@ class batchlog_manager : public peering_sharded_service<batchlog_manager> {
public:
using post_replay_cleanup = bool_class<class post_replay_cleanup_tag>;
struct stats {
uint64_t write_attempts = 0;
};
private:
static constexpr std::chrono::seconds replay_interval = std::chrono::seconds(60);
static constexpr uint32_t page_size = 128; // same as HHOM, for now, w/out using any heuristics. TODO: set based on avg batch size.
@@ -62,9 +67,7 @@ private:
using clock_type = lowres_clock;
struct stats {
uint64_t write_attempts = 0;
} _stats;
stats _stats;
seastar::metrics::metric_groups _metrics;
@@ -109,7 +112,7 @@ public:
return _last_replay;
}
const stats& stats() const {
const stats& get_stats() const {
return _stats;
}
private:

View File

@@ -693,7 +693,7 @@ SEASTAR_TEST_CASE(test_batchlog_replay_write_time) {
auto get_write_attempts = [&] () -> uint64_t {
return env.batchlog_manager().map_reduce0([] (const db::batchlog_manager& bm) {
return bm.stats().write_attempts;
return bm.get_stats().write_attempts;
}, uint64_t(0), std::plus<uint64_t>{}).get();
};