26#ifndef TEMPTABLE_KV_STORE_LOGGER_H
27#define TEMPTABLE_KV_STORE_LOGGER_H
40template <
typename T,
bool DebugBuild>
55 std::vector<Key_value_store_stats>
m_stats;
63 std::vector<Key_value_store_stats>
stats() {
64 auto &kv_store_lock =
static_cast<T &
>(*this).m_lock;
65 typename T::Exclusive_or_shared_lock
lock(kv_store_lock);
75 const auto &kv_store =
static_cast<T &
>(*this).m_kv_store;
76 m_stats.push_back({
event, kv_store.size(), kv_store.bucket_count(),
77 kv_store.load_factor(), kv_store.max_load_factor(),
78 kv_store.max_bucket_count(),
85 const auto &kv_store =
static_cast<T &
>(*this).m_kv_store;
87 "temptable_api_kv_store",
88 (
"this=%p size=%zu; bucket_count=%zu load_factor=%f "
90 "max_bucket_count=%zu",
91 this, kv_store.size(), kv_store.bucket_count(), kv_store.load_factor(),
92 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:55
std::vector< Key_value_store_stats > stats()
Returns a snapshot of stats collected.
Definition: kv_store_logger.h:63
void log(Key_value_store_stats::Event event)
Appends a new entry to stats container with the given event.
Definition: kv_store_logger.h:74
void dbug_print()
DBUG_PRINT's the stats of underlying key-value store implementation.
Definition: kv_store_logger.h:84
Default Key_value_store logging facility which turns to no-op in non-debug builds.
Definition: kv_store_logger.h:41
void dbug_print()
Definition: kv_store_logger.h:46
void log(Key_value_store_stats::Event)
Definition: kv_store_logger.h:43
TempTable key-value store stats description.
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:180
pid_type get_id()
Definition: process.h:47
Definition: allocator.h:44
static std::mutex lock
Definition: net_ns.cc:55
required string event
Definition: replication_group_member_actions.proto:31
Event
Definition: kv_store_stats.h:39