6#include <userver/clients/dns/common.hpp>
7#include <userver/clients/dns/config.hpp>
8#include <userver/clients/dns/exception.hpp>
9#include <userver/engine/deadline.hpp>
10#include <userver/engine/io/sockaddr.hpp>
11#include <userver/engine/task/task_processor_fwd.hpp>
12#include <userver/utils/fast_pimpl.hpp>
13#include <userver/utils/statistics/relaxed_counter.hpp>
15USERVER_NAMESPACE_BEGIN
17namespace clients::dns {
28 struct LookupSourceCounters {
29 utils::statistics::RelaxedCounter<size_t> file{0};
30 utils::statistics::RelaxedCounter<size_t> cached{0};
31 utils::statistics::RelaxedCounter<size_t> cached_stale{0};
32 utils::statistics::RelaxedCounter<size_t> cached_failure{0};
33 utils::statistics::RelaxedCounter<size_t> network{0};
34 utils::statistics::RelaxedCounter<size_t> network_failure{0};
37 Resolver(engine::TaskProcessor& fs_task_processor,
38 const ResolverConfig& config);
39 Resolver(
const Resolver&) =
delete;
40 Resolver(Resolver&&) =
delete;
52 AddrVector Resolve(
const std::string& name, engine::Deadline deadline);
55 const LookupSourceCounters& GetLookupSourceCounters()
const;
61 void FlushNetworkCache();
64 void FlushNetworkCache(
const std::string& name);
68 constexpr static size_t kSize = 1728;
69 constexpr static size_t kAlignment = 16;
70 utils::FastPimpl<Impl, kSize, kAlignment> impl_;