Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
kcenon::monitoring::retry_config Struct Reference

Retry configuration. More...

#include <retry_policy.h>

Collaboration diagram for kcenon::monitoring::retry_config:
Collaboration graph

Public Member Functions

bool validate () const
 Validate configuration.
 

Public Attributes

size_t max_attempts = 3
 
retry_strategy strategy = retry_strategy::exponential_backoff
 
std::chrono::milliseconds initial_delay = std::chrono::milliseconds(1000)
 
std::chrono::milliseconds max_delay = std::chrono::milliseconds(30000)
 
double backoff_multiplier = 2.0
 
std::function< bool(const error_info &)> should_retry = nullptr
 

Detailed Description

Retry configuration.

Examples
graceful_degradation_example.cpp, and health_reliability_example.cpp.

Definition at line 54 of file retry_policy.h.

Member Function Documentation

◆ validate()

bool kcenon::monitoring::retry_config::validate ( ) const
inline

Validate configuration.

Returns
true if configuration is valid

Definition at line 66 of file retry_policy.h.

66 {
67 if (max_attempts == 0) {
68 return false;
69 }
70 if (backoff_multiplier < 1.0) {
71 return false;
72 }
73 return true;
74 }

References backoff_multiplier, and max_attempts.

Referenced by TEST_F(), and kcenon::monitoring::fault_tolerance_config::validate().

Here is the caller graph for this function:

Member Data Documentation

◆ backoff_multiplier

◆ initial_delay

◆ max_attempts

◆ max_delay

std::chrono::milliseconds kcenon::monitoring::retry_config::max_delay = std::chrono::milliseconds(30000)

◆ should_retry

std::function<bool(const error_info&)> kcenon::monitoring::retry_config::should_retry = nullptr

Definition at line 60 of file retry_policy.h.

Referenced by kcenon::monitoring::retry_executor< T >::execute(), and TEST_F().

◆ strategy


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