26#ifndef TEMPTABLE_SHARDED_KV_STORE_LOGGER_H
27#define TEMPTABLE_SHARDED_KV_STORE_LOGGER_H
40template <
typename T,
bool DebugBuild>
65 auto &kv_store_shards =
static_cast<T &
>(*this).m_kv_store_shard;
66 uint32_t shard_id [[maybe_unused]] = 0;
67 for (
auto &kv : kv_store_shards) {
68 auto kv_shard_stats = kv.shard.stats();
69 size_t nr_of_emplace_events = std::count_if(
70 kv_shard_stats.begin(), kv_shard_stats.end(), [](
auto &stat) {
71 return stat.event == Key_value_store_stats::Event::EMPLACE;
80 size_t nr_of_erase_events = kv_shard_stats.size() - nr_of_emplace_events;
84 (
"shard_id=%u insertions=%zu removals=%zu", shard_id,
85 nr_of_emplace_events, nr_of_erase_events));
86 for (
auto &stat : kv_shard_stats) {
88 "temptable_api_sharded_kv_store_debug",
89 (
"shard_id=%u event=%d size=%zu bucket_count=%zu load_factor=%f "
91 "max_bucket_count=%zu thread_id=%s",
92 shard_id,
static_cast<int>(stat.event), stat.size,
93 stat.bucket_count, stat.load_factor, stat.max_load_factor,
94 stat.max_bucket_count,
95 std_thread_id_to_str(stat.thread_id).c_str()));
TempTable key-value store stats description.
#define MY_COMPILER_DIAGNOSTIC_PUSH()
save the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:284
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:285
#define MY_COMPILER_CLANG_WORKAROUND_FALSE_POSITIVE_UNUSED_VARIABLE_WARNING()
ignore -Wunused-variable compiler warnings for @see @ref
Definition: my_compiler.h:355
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:180
Definition: allocator.h:44
void dbug_print()
DBUG_PRINT's the stats of each shard and additionally some further stats which are deduced from it,...
Definition: sharded_kv_store_logger.h:53
Default Sharded_key_value_store logging facility which turns to no-op in non-debug builds.
Definition: sharded_kv_store_logger.h:41
void dbug_print()
Definition: sharded_kv_store_logger.h:42
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:509