MySQL 26.10.0
Source Code Documentation
hm::Retry_Timer Class Reference

Retry timer with backoff. More...

#include <health_monitor_timer.h>

Public Member Functions

 Retry_Timer (int max_retries)
 
bool wait ()
 Retry Timer - Wait. More...
 
void reset ()
 
int max_retries () const
 
void set_max_retries (int max_retries)
 
int retry_count () const
 
int remaining () const
 
int next_wait () const
 
std::string format_status () const
 Retry Timer - Print status. More...
 

Private Attributes

int m_max_retries {0}
 
int m_retry_count {0}
 
int m_wait_ms {0}
 
int m_next_wait_ms {0}
 

Detailed Description

Retry timer with backoff.

  • Used for retrying operations e.g. setting SRO, terminating connections, etc.
  • Driven by a sleep wait interval until max retries reached
  • Unrelated to the Collector base interval

Constructor & Destructor Documentation

◆ Retry_Timer()

hm::Retry_Timer::Retry_Timer ( int  max_retries)
inlineexplicit

Member Function Documentation

◆ format_status()

std::string hm::Retry_Timer::format_status ( ) const

Retry Timer - Print status.

  • Return formatted string with timer settings

◆ max_retries()

int hm::Retry_Timer::max_retries ( ) const
inline

◆ next_wait()

int hm::Retry_Timer::next_wait ( ) const
inline

◆ remaining()

int hm::Retry_Timer::remaining ( ) const
inline

◆ reset()

void hm::Retry_Timer::reset ( )

◆ retry_count()

int hm::Retry_Timer::retry_count ( ) const
inline

◆ set_max_retries()

void hm::Retry_Timer::set_max_retries ( int  max_retries)
inline

◆ wait()

bool hm::Retry_Timer::wait ( )

Retry Timer - Wait.

  • Wait with exponential backoff 1(0), 2, 4, 8, ...
    Returns
    true to try again, false if max attempts reached

Member Data Documentation

◆ m_max_retries

int hm::Retry_Timer::m_max_retries {0}
private

◆ m_next_wait_ms

int hm::Retry_Timer::m_next_wait_ms {0}
private

◆ m_retry_count

int hm::Retry_Timer::m_retry_count {0}
private

◆ m_wait_ms

int hm::Retry_Timer::m_wait_ms {0}
private

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