5#include <userver/congestion_control/controllers/linear_config.hpp>
6#include <userver/congestion_control/controllers/v2.hpp>
7#include <userver/congestion_control/limiter.hpp>
8#include <userver/dynamic_config/source.hpp>
9#include <userver/utils/periodic_task.hpp>
10#include <userver/utils/sliding_interval.hpp>
11#include <userver/yaml_config/yaml_config.hpp>
13USERVER_NAMESPACE_BEGIN
17class LinearController
final :
public Controller {
22 const std::string& name,
26 const StaticConfig& config,
27 dynamic_config::Source config_source,
28 std::function<v2::
Config(
const dynamic_config::Snapshot&)> config_getter
35 utils::SlidingInterval<int64_t> current_load_;
36 utils::SlidingInterval<int64_t> long_timings_;
37 utils::SlidingInterval<int64_t> short_timings_;
38 std::optional<std::size_t> current_limit_;
39 std::size_t epochs_passed_{0};
41 dynamic_config::Source config_source_;
42 std::function<v2::
Config(
const dynamic_config::Snapshot&)> config_getter_;
45LinearController::StaticConfig