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

Configuration for rate limiting. More...

#include <resource_manager.h>

Collaboration diagram for kcenon::monitoring::rate_limit_config:
Collaboration graph

Public Member Functions

bool validate () const
 Validate configuration.
 

Public Attributes

double rate_per_second = 100.0
 Rate of token refill per second.
 
size_t burst_capacity = 10
 Maximum burst capacity.
 
throttling_strategy strategy = throttling_strategy::reject
 

Detailed Description

Configuration for rate limiting.

Definition at line 86 of file resource_manager.h.

Member Function Documentation

◆ validate()

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

Validate configuration.

Returns
true if configuration is valid

Definition at line 95 of file resource_manager.h.

95 {
96 return rate_per_second > 0 && burst_capacity > 0;
97 }
size_t burst_capacity
Maximum burst capacity.
double rate_per_second
Rate of token refill per second.

References burst_capacity, and rate_per_second.

Referenced by TEST_F().

Here is the caller graph for this function:

Member Data Documentation

◆ burst_capacity

size_t kcenon::monitoring::rate_limit_config::burst_capacity = 10

Maximum burst capacity.

Definition at line 88 of file resource_manager.h.

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

◆ rate_per_second

double kcenon::monitoring::rate_limit_config::rate_per_second = 100.0

Rate of token refill per second.

Definition at line 87 of file resource_manager.h.

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

◆ strategy

throttling_strategy kcenon::monitoring::rate_limit_config::strategy = throttling_strategy::reject

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