7#include <unordered_map>
9#include <userver/dynamic_config/snapshot.hpp>
10#include <userver/formats/json/value.hpp>
11#include <userver/yaml_config/yaml_config.hpp>
13USERVER_NAMESPACE_BEGIN
18std::chrono::milliseconds ParseMs(
19 const formats::
json::Value& value,
20 std::optional<std::chrono::milliseconds> default_value = {});
23extern const std::string_view kDump;
24extern const std::string_view kMaxDumpAge;
25extern const std::string_view kMinDumpInterval;
27struct ConfigPatch
final {
28 std::optional<
bool> dumps_enabled;
29 std::optional<std::chrono::milliseconds> min_dump_interval;
32ConfigPatch Parse(
const formats::
json::Value& value,
33 formats::
parse::
To<ConfigPatch>);
37 std::string_view dump_root);
40 uint64_t dump_format_version;
42 std::string dump_directory;
43 std::string fs_task_processor;
44 uint64_t max_dump_count;
45 std::optional<std::chrono::milliseconds> max_dump_age;
46 bool max_dump_age_set;
47 bool dump_is_encrypted;
49 bool static_dumps_enabled;
50 std::chrono::milliseconds static_min_dump_interval;
53struct DynamicConfig
final {
54 explicit DynamicConfig(
const Config& config, ConfigPatch&& patch);
56 bool operator==(
const DynamicConfig& other)
const noexcept;
57 bool operator!=(
const DynamicConfig& other)
const noexcept;
60 std::chrono::milliseconds min_dump_interval;
63extern const dynamic_config::Key<std::unordered_map<std::string, ConfigPatch>>