userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
ping.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <
userver/components/state.hpp
>
7
#include <
userver/server/handlers/http_handler_base.hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
server::handlers
{
12
33
class
PingBase :
public
HttpHandlerBase {
34
public
:
35
PingBase(
const
components::ComponentConfig
& config,
const
components::ComponentContext
& component_context);
36
37
std::string
HandleRequestThrow
(
const
http::HttpRequest
&
request
,
request::RequestContext
& context)
const override
;
38
39
private
:
40
const
components::State
components_;
41
};
42
55
class
Ping final :
public
PingBase {
56
public
:
57
Ping(
const
components::ComponentConfig
& config,
const
components::ComponentContext
& component_context);
58
61
static
constexpr
std::string_view
kName
=
"handler-ping"
;
62
63
std::string
HandleRequestThrow
(
const
http::HttpRequest
&
request
,
request::RequestContext
& context)
const override
;
64
65
void
OnAllComponentsLoaded
()
override
;
66
67
static
yaml_config::Schema
GetStaticConfigSchema
();
68
69
private
:
70
void
AppendWeightHeaders(
http::HttpResponse
&)
const
;
71
72
std::chrono::steady_clock::time_point load_time_{};
73
std::chrono::seconds awacs_weight_warmup_time_{60};
74
};
75
76
}
// namespace server::handlers
77
78
template
<>
79
inline
constexpr
bool
components::kHasValidate<server::handlers::Ping>
=
true
;
80
81
USERVER_NAMESPACE_END
userver
server
handlers
ping.hpp
Generated on
for userver by
Doxygen
1.17.0