mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-24 12:51:39 +02:00
log: clarify RATELIMIT_MAX_BYTES comment, use RATELIMIT_WINDOW
Co-Authored-By: stickies-v <stickies-v@protonmail.com>
Github-Pull: #33011
Rebased-From: 8319a13468
This commit is contained in:
@@ -1387,7 +1387,7 @@ bool AppInitMain(NodeContext& node, interfaces::BlockAndHeaderTipInfo* tip_info)
|
|||||||
LogInstance().SetRateLimiting(std::make_unique<BCLog::LogRateLimiter>(
|
LogInstance().SetRateLimiting(std::make_unique<BCLog::LogRateLimiter>(
|
||||||
[&scheduler](auto func, auto window) { scheduler.scheduleEvery(std::move(func), window); },
|
[&scheduler](auto func, auto window) { scheduler.scheduleEvery(std::move(func), window); },
|
||||||
BCLog::RATELIMIT_MAX_BYTES,
|
BCLog::RATELIMIT_MAX_BYTES,
|
||||||
1h));
|
BCLog::RATELIMIT_WINDOW));
|
||||||
|
|
||||||
assert(!node.validation_signals);
|
assert(!node.validation_signals);
|
||||||
node.validation_signals = std::make_unique<ValidationSignals>(std::make_unique<SerialTaskRunner>(scheduler));
|
node.validation_signals = std::make_unique<ValidationSignals>(std::make_unique<SerialTaskRunner>(scheduler));
|
||||||
|
@@ -104,7 +104,8 @@ namespace BCLog {
|
|||||||
};
|
};
|
||||||
constexpr auto DEFAULT_LOG_LEVEL{Level::Debug};
|
constexpr auto DEFAULT_LOG_LEVEL{Level::Debug};
|
||||||
constexpr size_t DEFAULT_MAX_LOG_BUFFER{1'000'000}; // buffer up to 1MB of log data prior to StartLogging
|
constexpr size_t DEFAULT_MAX_LOG_BUFFER{1'000'000}; // buffer up to 1MB of log data prior to StartLogging
|
||||||
constexpr uint64_t RATELIMIT_MAX_BYTES{1024 * 1024}; // maximum number of bytes that can be logged within one window
|
constexpr uint64_t RATELIMIT_MAX_BYTES{1024 * 1024}; // maximum number of bytes per source location that can be logged within the RATELIMIT_WINDOW
|
||||||
|
constexpr auto RATELIMIT_WINDOW{1h}; // time window after which log ratelimit stats are reset
|
||||||
|
|
||||||
//! Keeps track of an individual source location and how many available bytes are left for logging from it.
|
//! Keeps track of an individual source location and how many available bytes are left for logging from it.
|
||||||
class LogLimitStats
|
class LogLimitStats
|
||||||
|
Reference in New Issue
Block a user