27#ifndef TEMPTABLE_KV_STORE_LOGGER_H
28#define TEMPTABLE_KV_STORE_LOGGER_H
41template <
typename T,
bool DebugBuild>
56 std::vector<Key_value_store_stats>
m_stats;
64 std::vector<Key_value_store_stats>
stats() {
65 auto &kv_store_lock =
static_cast<T &
>(*this).m_lock;
66 typename T::Exclusive_or_shared_lock
lock(kv_store_lock);
76 const auto &kv_store =
static_cast<T &
>(*this).m_kv_store;
77 m_stats.push_back({
event, kv_store.size(), kv_store.bucket_count(),
78 kv_store.load_factor(), kv_store.max_load_factor(),
79 kv_store.max_bucket_count(),
86 const auto &kv_store =
static_cast<T &
>(*this).m_kv_store;
88 "temptable_api_kv_store",
89 (
"this=%p size=%zu; bucket_count=%zu load_factor=%f "
91 "max_bucket_count=%zu",
92 this, kv_store.size(), kv_store.bucket_count(), kv_store.load_factor(),
93 kv_store.max_load_factor(), kv_store.max_bucket_count()));
std::vector< Key_value_store_stats > m_stats
Container of stats that we will be collecting.
Definition: kv_store_logger.h:56
std::vector< Key_value_store_stats > stats()
Returns a snapshot of stats collected.
Definition: kv_store_logger.h:64
void log(Key_value_store_stats::Event event)
Appends a new entry to stats container with the given event.
Definition: kv_store_logger.h:75
void dbug_print()
DBUG_PRINT's the stats of underlying key-value store implementation.
Definition: kv_store_logger.h:85
Default Key_value_store logging facility which turns to no-op in non-debug builds.
Definition: kv_store_logger.h:42
void dbug_print()
Definition: kv_store_logger.h:47
void log(Key_value_store_stats::Event)
Definition: kv_store_logger.h:44
TempTable key-value store stats description.
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
pid_type get_id()
Definition: process.h:48
Definition: allocator.h:45
static std::mutex lock
Definition: net_ns.cc:56
required string event
Definition: replication_group_member_actions.proto:32
Event
Definition: kv_store_stats.h:40