userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
linear_config.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/congestion_control/controllers/linear_config.hpp
4
/// @brief Linear congestion control controller configuration (v2)
5
6
#
include
<
chrono
>
7
#
include
<
cstddef
>
8
9
#
include
<
userver
/
dynamic_config
/
snapshot
.
hpp
>
10
11
USERVER_NAMESPACE_BEGIN
12
13
namespace
congestion_control
::v2 {
14
15
struct
Config
{
16
double
errors_threshold_percent{5.0};
// 5%
17
std::size_t safe_delta_limit{10};
18
std::size_t timings_burst_threshold{5};
19
std::chrono::milliseconds min_timings{20};
20
std::size_t min_limit{10};
21
std::size_t min_qps{10};
22
bool
use_separate_stats{
false
};
23
};
24
25
template
<
typename
T>
26
Config
ConvertConfig(
const
T& cfg) {
27
Config
config;
28
config.errors_threshold_percent = cfg.errors_threshold_percent;
29
config.safe_delta_limit = cfg.safe_delta_limit;
30
config.timings_burst_threshold = cfg.timings_burst_times_threshold;
31
config.min_timings = cfg.min_timings_ms;
32
config.min_limit = cfg.min_limit;
33
config.min_qps = cfg.min_qps;
34
config.use_separate_stats = cfg.use_separate_stats;
35
return
config;
36
}
37
38
Config
Parse(
const
formats::
json
::
Value
& value, formats::
parse
::
To
<
Config
>);
39
40
}
// namespace congestion_control::v2
41
42
USERVER_NAMESPACE_END
userver
congestion_control
controllers
linear_config.hpp
Generated on
for userver by
Doxygen
1.17.0