|
| ThrottleLogger (uint64_t throttleMillis) |
| Constructs a logger with the specified throttle in milliseconds (throttleMillis). More...
|
|
uint32_t | counter () const |
| Gets the total number of log attempts. More...
|
|
bool | isThrottled () |
| Returns false if a log should be output. More...
|
|
|
using | Clock = std::chrono::steady_clock |
|
|
uint64_t | millis (const Clock::time_point &now) const |
|
Simple throttle logger.
- Note
- Instances need to be threadsafe due to usage in CATAPULT_LOG_THROTTLE.
◆ Clock
◆ ThrottleLogger()
catapult::utils::ThrottleLogger::ThrottleLogger |
( |
uint64_t |
throttleMillis | ) |
|
|
inlineexplicit |
Constructs a logger with the specified throttle in milliseconds (throttleMillis).
◆ counter()
uint32_t catapult::utils::ThrottleLogger::counter |
( |
| ) |
const |
|
inline |
Gets the total number of log attempts.
◆ isThrottled()
bool catapult::utils::ThrottleLogger::isThrottled |
( |
| ) |
|
|
inline |
Returns false
if a log should be output.
◆ millis()
uint64_t catapult::utils::ThrottleLogger::millis |
( |
const Clock::time_point & |
now | ) |
const |
|
inlineprivate |
◆ m_counter
std::atomic<uint32_t> catapult::utils::ThrottleLogger::m_counter |
|
private |
◆ m_last
Clock::time_point catapult::utils::ThrottleLogger::m_last |
|
private |
◆ m_lock
◆ m_throttleMillis
uint64_t catapult::utils::ThrottleLogger::m_throttleMillis |
|
private |
The documentation for this class was generated from the following file: