3#include <userver/formats/json/value.hpp>
5#include <userver/components/component_context.hpp>
6#include <userver/engine/task/task_processor_fwd.hpp>
7#include <userver/server/congestion_control/limiter.hpp>
8#include <userver/server/handlers/fallback_handlers.hpp>
9#include <userver/server/handlers/http_handler_base.hpp>
10#include <userver/storages/secdist/component.hpp>
11#include <userver/utils/statistics/fwd.hpp>
13USERVER_NAMESPACE_BEGIN
22class HttpRequestHandler;
30class Server
final :
public congestion_control::
Limitee {
32 Server(ServerConfig config,
const storages::
secdist::SecdistConfig& secdist,
33 const components::ComponentContext& component_context);
36 const ServerConfig& GetConfig()
const;
38 void WriteMonitorData(
utils::statistics::Writer& writer)
const;
40 void WriteTotalHandlerStatistics(
utils::statistics::Writer& writer)
const;
42 net::Stats GetServerStats()
const;
45 engine::TaskProcessor& task_processor);
47 size_t GetThrottlableHandlersCount()
const;
49 const http::HttpRequestHandler& GetHttpRequestHandler(
50 bool is_monitor =
false)
const;
56 RequestsView& GetRequestsView();
58 void SetLimit(std::optional<size_t> new_limit)
override;
60 void SetRpsRatelimit(std::optional<size_t> rps);
62 void SetRpsRatelimitStatusCode(http::
HttpStatus status_code);
65 std::unique_ptr<ServerImpl> pimpl;