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,
const ResolverConfig& config);
38 Resolver(
const Resolver&) =
delete;
39 Resolver(Resolver&&) =
delete;
51 AddrVector Resolve(
const std::string& name, engine::Deadline deadline);
54 const LookupSourceCounters& GetLookupSourceCounters()
const;
60 void FlushNetworkCache();
63 void FlushNetworkCache(
const std::string& name);
67 constexpr static size_t kSize = 1728;
68 constexpr static size_t kAlignment = 16;
69 utils::FastPimpl<Impl, kSize, kAlignment> impl_;