MySQL 9.1.0
Source Code Documentation
ib::Throttler Class Reference

Allows to monitor an event processing times, allowing to throttle the processing to one per throttle_delay_sec. More...

#include <ut0ut.h>

Public Member Functions

 Throttler (seconds delay=seconds{10})
 
bool apply ()
 Checks if the item should be processed or ignored to not process them more frequently than one per throttle_delay_sec. More...
 

Private Types

using seconds = std::chrono::duration< uint64_t >
 
using clock = std::chrono::steady_clock
 
using time_point = std::chrono::time_point< clock, seconds >
 

Private Attributes

std::atomic< time_pointm_last_applied_time
 
const seconds m_throttle_delay
 Throttle all items within that amount seconds from the last non throttled one. More...
 

Detailed Description

Allows to monitor an event processing times, allowing to throttle the processing to one per throttle_delay_sec.

Member Typedef Documentation

◆ clock

using ib::Throttler::clock = std::chrono::steady_clock
private

◆ seconds

using ib::Throttler::seconds = std::chrono::duration<uint64_t>
private

◆ time_point

using ib::Throttler::time_point = std::chrono::time_point<clock, seconds>
private

Constructor & Destructor Documentation

◆ Throttler()

ib::Throttler::Throttler ( seconds  delay = seconds{10})
inlineexplicit

Member Function Documentation

◆ apply()

bool ib::Throttler::apply ( )
inline

Checks if the item should be processed or ignored to not process them more frequently than one per throttle_delay_sec.

Member Data Documentation

◆ m_last_applied_time

std::atomic<time_point> ib::Throttler::m_last_applied_time
private

◆ m_throttle_delay

const seconds ib::Throttler::m_throttle_delay
private

Throttle all items within that amount seconds from the last non throttled one.


The documentation for this class was generated from the following file: