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>
13#include <dynamic_config/variables/USERVER_DUMPS.hpp>
15USERVER_NAMESPACE_BEGIN
20std::chrono::milliseconds ParseMs(
21 const formats::json::Value& value,
22 std::optional<std::chrono::milliseconds> default_value = {}
26extern const std::string_view kDump;
27extern const std::string_view kMaxDumpAge;
28extern const std::string_view kMinDumpInterval;
30using ConfigPatch = ::dynamic_config::userver_dumps::ConfigPatch;
33 Config(std::string name,
const yaml_config::YamlConfig& config, std::string_view dump_root);
36 uint64_t dump_format_version;
38 std::string dump_directory;
39 std::optional<std::string> fs_task_processor;
40 uint64_t max_dump_count;
41 std::optional<std::chrono::milliseconds> max_dump_age;
42 bool max_dump_age_set;
43 bool dump_is_encrypted;
45 bool static_dumps_enabled;
46 std::chrono::milliseconds static_min_dump_interval;
49struct DynamicConfig
final {
50 explicit DynamicConfig(
const Config& config, ConfigPatch&& patch);
52 bool operator==(
const DynamicConfig& other)
const noexcept;
53 bool operator!=(
const DynamicConfig& other)
const noexcept;
56 std::chrono::milliseconds min_dump_interval;