27#ifndef TEMPTABLE_SHARDED_KV_STORE_LOGGER_H
28#define TEMPTABLE_SHARDED_KV_STORE_LOGGER_H
41template <
typename T,
bool DebugBuild>
66 auto &kv_store_shards =
static_cast<T &
>(*this).m_kv_store_shard;
67 uint32_t shard_id [[maybe_unused]] = 0;
68 for (
auto &kv : kv_store_shards) {
69 auto kv_shard_stats = kv.shard.stats();
70 size_t nr_of_emplace_events = std::count_if(
71 kv_shard_stats.begin(), kv_shard_stats.end(), [](
auto &stat) {
72 return stat.event == Key_value_store_stats::Event::EMPLACE;
81 size_t nr_of_erase_events = kv_shard_stats.size() - nr_of_emplace_events;
85 (
"shard_id=%u insertions=%zu removals=%zu", shard_id,
86 nr_of_emplace_events, nr_of_erase_events));
87 for (
auto &stat : kv_shard_stats) {
89 "temptable_api_sharded_kv_store_debug",
90 (
"shard_id=%u event=%d size=%zu bucket_count=%zu load_factor=%f "
92 "max_bucket_count=%zu thread_id=%s",
93 shard_id,
static_cast<int>(stat.event), stat.size,
94 stat.bucket_count, stat.load_factor, stat.max_load_factor,
95 stat.max_bucket_count,
96 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:285
#define MY_COMPILER_DIAGNOSTIC_POP()
restore the compiler's diagnostic (enabled warnings, errors, ...) state
Definition: my_compiler.h:286
#define MY_COMPILER_CLANG_WORKAROUND_FALSE_POSITIVE_UNUSED_VARIABLE_WARNING()
ignore -Wunused-variable compiler warnings for @see @ref
Definition: my_compiler.h:356
#define DBUG_PRINT(keyword, arglist)
Definition: my_dbug.h:181
Definition: allocator.h:45
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:54
Default Sharded_key_value_store logging facility which turns to no-op in non-debug builds.
Definition: sharded_kv_store_logger.h:42
void dbug_print()
Definition: sharded_kv_store_logger.h:43
unsigned long id[MAX_DEAD]
Definition: xcom_base.cc:510