Github   Telegram
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
congestion_control::Component Class Referencefinal

Component to limit too active requests, also known as CC. More...

#include <userver/congestion_control/component.hpp>

+ Inheritance diagram for congestion_control::Component:
+ Collaboration diagram for congestion_control::Component:

Public Member Functions

 Component (const components::ComponentConfig &, const components::ComponentContext &)
 
- Public Member Functions inherited from components::LoggableComponentBase
 LoggableComponentBase (const ComponentConfig &, const ComponentContext &)
 
 LoggableComponentBase (LoggableComponentBase &&)=delete
 
 LoggableComponentBase (const LoggableComponentBase &)=delete
 
 ~LoggableComponentBase () override=default
 
ComponentHealth GetComponentHealth () const override
 
void OnLoadingCancelled () override
 
void OnAllComponentsLoaded () override
 
void OnAllComponentsAreStopping () override
 

Static Public Member Functions

static yaml_config::Schema GetStaticConfigSchema ()
 
- Static Public Member Functions inherited from components::LoggableComponentBase
static yaml_config::Schema GetStaticConfigSchema ()
 

Static Public Attributes

static constexpr std::string_view kName = "congestion-control"
 

Detailed Description

Component to limit too active requests, also known as CC.

Dynamic config

Static options:

Name Description Default value
fake-mode if set, an actual throttling is skipped, but FSM is still working and producing informational logs false
min-cpu force fake-mode if the current cpu number is less than the specified value 1
only-rtc if set to true and hostinfo::IsInRtc() returns false then forces the fake-mode true
status-code HTTP status code for ratelimited responses 429

Static configuration example:

# yaml
congestion-control:
fake-mode: true
min-cpu: 2
only-rtc: false
# Uncomment if you want to change status code for ratelimited responses
# status-code: 503
# Common component options
load-enabled: true

Definition at line 39 of file component.hpp.

Member Data Documentation

◆ kName

constexpr std::string_view congestion_control::Component::kName = "congestion-control"
staticconstexpr

Definition at line 41 of file component.hpp.


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