mirror of
https://github.com/matrix-construct/construct
synced 2024-12-24 14:34:00 +01:00
ircd::db::database::env: Replace RB_DEBUG_DB_ENV w/ if constexpr.
This commit is contained in:
parent
57dbd72c82
commit
c2ee855346
3 changed files with 783 additions and 872 deletions
10
ircd/db.h
10
ircd/db.h
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
{
|
||||
|
|
1583
ircd/db_env.cc
1583
ircd/db_env.cc
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue