userver
C++ Async Framework
Loading...
Searching...
No Matches
settings.hpp
1
#
pragma
once
2
3
#
include
<
memory
>
4
#
include
<
string
>
5
#
include
<
vector
>
6
7
#
include
<
userver
/
yaml_config
/
yaml_config
.
hpp
>
8
9
USERVER_NAMESPACE_BEGIN
10
11
namespace
error_injection
{
12
13
/// What error injection hook may decide to do
14
enum
class
Verdict
{
15
Error
,
///< return error
16
Timeout
,
///< wait for deadline and return error
17
MaxDelay
,
///< wait for deadline w/o returning an error
18
RandomDelay
,
///< wait for [0; deadline] w/o returning an error
19
20
// Skip must be the last
21
22
Skip
,
///< no error
23
};
24
25
/// Artificial error injection settings
26
struct
Settings
final
{
27
/// error injection enabled
28
bool
enabled
{
false
};
29
30
/// error probability from range [0, 1]
31
double
probability
{0};
32
33
/// possible verdicts, will be chosen randomly, Verdict::Error if unspecified
34
std
::
vector
<
Verdict
>
possible_verdicts
;
35
};
36
37
Settings Parse(
const
yaml_config
::
YamlConfig
& value,
38
formats::
parse
::
To
<Settings>);
39
40
}
// namespace error_injection
41
42
USERVER_NAMESPACE_END
userver
error_injection
settings.hpp
Generated on Thu Oct 3 2024 13:10:03 for userver by
Doxygen
1.10.0