0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-05-29 00:03:45 +02:00

ircd::db::database::env: Replace RB_DEBUG_DB_ENV w/ if constexpr.

This commit is contained in:
Jason Volk 2023-01-18 20:47:09 -08:00
parent 57dbd72c82
commit c2ee855346
3 changed files with 783 additions and 872 deletions

View file

@ -10,12 +10,12 @@
#pragma once
/// Uncomment or -D this #define to enable extensive log messages covering the
/// entire RocksDB callback surface. This is only useful for developers
/// specifically working on the backend of the DB and no real use for
/// developers making frontend queries to it. Massively verbose.
/// Enable extensive log messages covering the entire RocksDB callback surface.
/// This is only useful for developers specifically working on the backend of
/// the DB and no real use for developers making frontend queries to it.
/// Massively verbose.
///
//#define RB_DEBUG_DB_ENV
#define RB_DEBUG_DB_ENV 0
/// This #define is more useful to developers making queries to the database.
/// It is still so verbose that it goes beyond what is tolerable and generally

View file

@ -3339,7 +3339,6 @@ const noexcept
{
const ctx::uninterruptible::nothrow ui;
#ifdef RB_DEBUG_DB_ENV
const auto typestr
{
type == kValue?
@ -3348,7 +3347,6 @@ const noexcept
"MERGE"_sv:
"BLOB"_sv
};
#endif
static const compactor::callback empty;
const db::compactor::callback &callback
@ -3365,22 +3363,21 @@ const noexcept
if(!callback)
return Decision::kKeep;
#ifdef RB_DEBUG_DB_ENV
log::debug
{
log, "[%s]'%s': compaction level:%d key:%zu@%p type:%s old:%zu@%p new:%p skip:%p",
d->name,
c->name,
level,
size(key),
data(key),
typestr,
size(oldval),
data(oldval),
(const void *)newval,
(const void *)skip
};
#endif
if constexpr(RB_DEBUG_DB_ENV)
log::debug
{
log, "[%s]'%s': compaction level:%d key:%zu@%p type:%s old:%zu@%p new:%p skip:%p",
d->name,
c->name,
level,
size(key),
data(key),
typestr,
size(oldval),
data(oldval),
(const void *)newval,
(const void *)skip
};
const compactor::args args
{
@ -3538,21 +3535,20 @@ ircd::db::database::rate_limiter::RequestToken(size_t bytes,
OpType type)
noexcept
{
#ifdef RB_DEBUG_DB_ENV
log::debug
{
log, "[%s] Rate Limiter request bytes:%zu alignment:%zu prio:%s type:%s",
db::name(*d),
bytes,
alignment,
reflect(prio),
type == OpType::kWrite?
"WRITE"_sv:
type == OpType::kRead?
"READ"_sv:
"????"_sv,
};
#endif
if constexpr(RB_DEBUG_DB_ENV)
log::debug
{
log, "[%s] Rate Limiter request bytes:%zu alignment:%zu prio:%s type:%s",
db::name(*d),
bytes,
alignment,
reflect(prio),
type == OpType::kWrite?
"WRITE"_sv:
type == OpType::kRead?
"READ"_sv:
"????"_sv,
};
assert(prio <= IOPriority::IO_TOTAL);
{

File diff suppressed because it is too large Load diff