diff options
author | babenko <babenko@yandex-team.com> | 2024-11-27 14:25:50 +0300 |
---|---|---|
committer | babenko <babenko@yandex-team.com> | 2024-11-27 14:36:57 +0300 |
commit | ffe056ac974135f1d74039e670e77c7104942e66 (patch) | |
tree | ec352aacf872df33c93603be9f9894945db1d064 | |
parent | e606e420944f69616a76684d07902a6f0b532893 (diff) | |
download | ydb-ffe056ac974135f1d74039e670e77c7104942e66.tar.gz |
YT-18571: Preliminary cosmetics in yt/yt/library/profiling
commit_hash:e8a05dc0a96252ede8cfdc0315026d41265c4ffa
38 files changed, 428 insertions, 396 deletions
diff --git a/yt/yt/core/actions/invoker_detail.cpp b/yt/yt/core/actions/invoker_detail.cpp index 573165bafb..d33514ae46 100644 --- a/yt/yt/core/actions/invoker_detail.cpp +++ b/yt/yt/core/actions/invoker_detail.cpp @@ -60,7 +60,7 @@ template struct NDetail::TMaybeVirtualInvokerBase<false>; //////////////////////////////////////////////////////////////////////////////// -TInvokerProfileWrapper::TInvokerProfileWrapper(NProfiling::IRegistryImplPtr registry, const TString& invokerFamily, const NProfiling::TTagSet& tagSet) +TInvokerProfileWrapper::TInvokerProfileWrapper(NProfiling::IRegistryPtr registry, const TString& invokerFamily, const NProfiling::TTagSet& tagSet) { auto profiler = NProfiling::TProfiler("/invoker", NProfiling::TProfiler::DefaultNamespace, tagSet, registry).WithHot(); WaitTimer_ = profiler.Timer(invokerFamily + "/wait"); diff --git a/yt/yt/core/actions/invoker_detail.h b/yt/yt/core/actions/invoker_detail.h index 5f5538a96f..8e79afab2b 100644 --- a/yt/yt/core/actions/invoker_detail.h +++ b/yt/yt/core/actions/invoker_detail.h @@ -58,7 +58,7 @@ public: * #invokerFamily defines a family of invokers, e.g. "serialized" or "prioriized" and appears in sensor's name. * #tagSet defines a particular instance of the invoker and appears in sensor's tags. */ - TInvokerProfileWrapper(NProfiling::IRegistryImplPtr registry, const TString& invokerFamily, const NProfiling::TTagSet& tagSet); + TInvokerProfileWrapper(NProfiling::IRegistryPtr registry, const TString& invokerFamily, const NProfiling::TTagSet& tagSet); protected: TClosure WrapCallback(TClosure callback); diff --git a/yt/yt/core/concurrency/action_queue.cpp b/yt/yt/core/concurrency/action_queue.cpp index 73b3021fe0..b00f91372f 100644 --- a/yt/yt/core/concurrency/action_queue.cpp +++ b/yt/yt/core/concurrency/action_queue.cpp @@ -116,7 +116,7 @@ public: TSerializedInvoker( IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) : TInvokerWrapper(std::move(underlyingInvoker)) , TInvokerProfileWrapper(std::move(registry), "/serialized", tagSet) { } @@ -244,7 +244,7 @@ private: } }; -IInvokerPtr CreateSerializedInvoker(IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, NProfiling::IRegistryImplPtr registry) +IInvokerPtr CreateSerializedInvoker(IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, NProfiling::IRegistryPtr registry) { if (underlyingInvoker->IsSerialized()) { return underlyingInvoker; @@ -253,7 +253,7 @@ IInvokerPtr CreateSerializedInvoker(IInvokerPtr underlyingInvoker, const NProfil return New<TSerializedInvoker>(std::move(underlyingInvoker), tagSet, registry); } -IInvokerPtr CreateSerializedInvoker(IInvokerPtr underlyingInvoker, const TString& invokerName, NProfiling::IRegistryImplPtr registry) +IInvokerPtr CreateSerializedInvoker(IInvokerPtr underlyingInvoker, const TString& invokerName, NProfiling::IRegistryPtr registry) { NProfiling::TTagSet tagSet; tagSet.AddTag(NProfiling::TTag("invoker", invokerName)); @@ -268,7 +268,7 @@ class TPrioritizedInvoker , public virtual IPrioritizedInvoker { public: - TPrioritizedInvoker(IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, NProfiling::IRegistryImplPtr registry) + TPrioritizedInvoker(IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, NProfiling::IRegistryPtr registry) : TInvokerWrapper(std::move(underlyingInvoker)) , TInvokerProfileWrapper(std::move(registry), "/prioritized", tagSet) { } @@ -321,12 +321,12 @@ private: }; -IPrioritizedInvokerPtr CreatePrioritizedInvoker(IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, NProfiling::IRegistryImplPtr registry) +IPrioritizedInvokerPtr CreatePrioritizedInvoker(IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, NProfiling::IRegistryPtr registry) { return New<TPrioritizedInvoker>(std::move(underlyingInvoker), std::move(tagSet), std::move(registry)); } -IPrioritizedInvokerPtr CreatePrioritizedInvoker(IInvokerPtr underlyingInvoker, const TString& invokerName, NProfiling::IRegistryImplPtr registry) +IPrioritizedInvokerPtr CreatePrioritizedInvoker(IInvokerPtr underlyingInvoker, const TString& invokerName, NProfiling::IRegistryPtr registry) { NProfiling::TTagSet tagSet; tagSet.AddTag(NProfiling::TTag("invoker", invokerName)); diff --git a/yt/yt/core/concurrency/action_queue.h b/yt/yt/core/concurrency/action_queue.h index 77c92bc490..2167b46dab 100644 --- a/yt/yt/core/concurrency/action_queue.h +++ b/yt/yt/core/concurrency/action_queue.h @@ -45,12 +45,12 @@ DEFINE_REFCOUNTED_TYPE(TActionQueue) IInvokerPtr CreateSerializedInvoker( IInvokerPtr underlyingInvoker, const TString& invokerName = "default", - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); IInvokerPtr CreateSerializedInvoker( IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); //////////////////////////////////////////////////////////////////////////////// @@ -61,12 +61,12 @@ IInvokerPtr CreateSerializedInvoker( IPrioritizedInvokerPtr CreatePrioritizedInvoker( IInvokerPtr underlyingInvoker, const TString& invokerName = "default", - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); IPrioritizedInvokerPtr CreatePrioritizedInvoker( IInvokerPtr underlyingInvoker, const NProfiling::TTagSet& tagSet, - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); //! Creates a wrapper around IInvoker that implements IPrioritizedInvoker but //! does not perform any actual reordering. Priorities passed to #IPrioritizedInvoker::Invoke diff --git a/yt/yt/core/concurrency/fair_share_action_queue-inl.h b/yt/yt/core/concurrency/fair_share_action_queue-inl.h index 5c3f95dc0e..9619f33276 100644 --- a/yt/yt/core/concurrency/fair_share_action_queue-inl.h +++ b/yt/yt/core/concurrency/fair_share_action_queue-inl.h @@ -17,7 +17,7 @@ public: const TString& threadName, const std::vector<TString>& queueNames, const THashMap<TString, std::vector<TString>>& bucketToQueues, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) : Queue_(CreateFairShareActionQueue(threadName, queueNames, bucketToQueues, std::move(registry))) { } @@ -41,7 +41,7 @@ template <typename EQueue, typename EBucket> IEnumIndexedFairShareActionQueuePtr<EQueue> CreateEnumIndexedFairShareActionQueue( const TString& threadName, const THashMap<EBucket, std::vector<EQueue>>& bucketToQueues, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) { std::vector<TString> queueNames; for (const auto& queueName : TEnumTraits<EQueue>::GetDomainNames()) { diff --git a/yt/yt/core/concurrency/fair_share_action_queue.cpp b/yt/yt/core/concurrency/fair_share_action_queue.cpp index 21a8add98a..db018103bc 100644 --- a/yt/yt/core/concurrency/fair_share_action_queue.cpp +++ b/yt/yt/core/concurrency/fair_share_action_queue.cpp @@ -30,7 +30,7 @@ public: const TString& threadName, const std::vector<TString>& queueNames, const THashMap<TString, std::vector<TString>>& bucketToQueues, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) : ShutdownCookie_(RegisterShutdownCallback( Format("FairShareActionQueue(%v)", threadName), BIND_NO_PROPAGATE(&TFairShareActionQueue::Shutdown, MakeWeak(this), /*graceful*/ false), @@ -171,7 +171,7 @@ IFairShareActionQueuePtr CreateFairShareActionQueue( const TString& threadName, const std::vector<TString>& queueNames, const THashMap<TString, std::vector<TString>>& bucketToQueues, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) { return New<TFairShareActionQueue>(threadName, queueNames, bucketToQueues, std::move(registry)); } diff --git a/yt/yt/core/concurrency/fair_share_action_queue.h b/yt/yt/core/concurrency/fair_share_action_queue.h index 33ac86a5ad..a1f8d4e2b1 100644 --- a/yt/yt/core/concurrency/fair_share_action_queue.h +++ b/yt/yt/core/concurrency/fair_share_action_queue.h @@ -28,7 +28,7 @@ IFairShareActionQueuePtr CreateFairShareActionQueue( const TString& threadName, const std::vector<TString>& queueNames, const THashMap<TString, std::vector<TString>>& bucketToQueues = {}, - NProfiling::IRegistryImplPtr registry = {}); + NProfiling::IRegistryPtr registry = {}); //////////////////////////////////////////////////////////////////////////////// @@ -47,7 +47,7 @@ template <typename EQueue, typename EBucket = EQueue> IEnumIndexedFairShareActionQueuePtr<EQueue> CreateEnumIndexedFairShareActionQueue( const TString& threadName, const THashMap<EBucket, std::vector<EQueue>>& bucketToQueues = {}, - NProfiling::IRegistryImplPtr registry = {}); + NProfiling::IRegistryPtr registry = {}); //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/concurrency/fair_share_invoker_pool-inl.h b/yt/yt/core/concurrency/fair_share_invoker_pool-inl.h index 69be67ae68..e9bdee7009 100644 --- a/yt/yt/core/concurrency/fair_share_invoker_pool-inl.h +++ b/yt/yt/core/concurrency/fair_share_invoker_pool-inl.h @@ -15,7 +15,7 @@ TDiagnosableInvokerPoolPtr CreateEnumIndexedProfiledFairShareInvokerPool( TFairShareCallbackQueueFactory callbackQueueFactory, TDuration actionTimeRelevancyHalflife, const TString& poolName, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) { using TTraits = TEnumTraits<EInvoker>; diff --git a/yt/yt/core/concurrency/fair_share_invoker_pool.cpp b/yt/yt/core/concurrency/fair_share_invoker_pool.cpp index 7e5644710a..3bc775914e 100644 --- a/yt/yt/core/concurrency/fair_share_invoker_pool.cpp +++ b/yt/yt/core/concurrency/fair_share_invoker_pool.cpp @@ -155,7 +155,7 @@ public: static TObject Create( const TString& /*poolName*/, std::vector<TString> /*bucketNames*/, - IRegistryImplPtr /*registry*/) + IRegistryPtr /*registry*/) { return {}; } @@ -206,7 +206,7 @@ public: static TObject Create( const TString& poolName, std::vector<TString> bucketNames, - IRegistryImplPtr registry) + IRegistryPtr registry) { return New<TFairShareInvokerPoolProfiler>(poolName, std::move(bucketNames), std::move(registry)); } @@ -241,7 +241,7 @@ private: TFairShareInvokerPoolProfiler( const TString& poolName, std::vector<TString> bucketNames, - IRegistryImplPtr registry) + IRegistryPtr registry) { Counters_.reserve(std::ssize(bucketNames)); BucketProfilerTags_.reserve(std::ssize(bucketNames)); @@ -252,7 +252,7 @@ private: } } - TCountersPtr CreateCounters(const TTagSet& tagSet, const IRegistryImplPtr& registry) { + TCountersPtr CreateCounters(const TTagSet& tagSet, const IRegistryPtr& registry) { auto profiler = TProfiler(registry, "/fair_share_invoker_pool").WithTags(tagSet).WithHot(); auto counters = std::make_unique<TCounters>(); @@ -324,7 +324,7 @@ public: TDuration actionTimeRelevancyHalflife, const TString& poolName = "", std::vector<TString> bucketNames = {}, - IRegistryImplPtr registry = nullptr) + IRegistryPtr registry = nullptr) : UnderlyingInvoker_(std::move(underlyingInvoker)) , Queue_(callbackQueueFactory(invokerCount)) , Profiler_(TPoolProfiler::Create(poolName, std::move(bucketNames), std::move(registry))) @@ -639,7 +639,7 @@ TDiagnosableInvokerPoolPtr CreateProfiledFairShareInvokerPool( TDuration actionTimeRelevancyHalflife, const TString& poolName, std::vector<TString> bucketNames, - IRegistryImplPtr registry) + IRegistryPtr registry) { YT_VERIFY(0 < std::ssize(bucketNames) && std::ssize(bucketNames) < 100); diff --git a/yt/yt/core/concurrency/fair_share_invoker_pool.h b/yt/yt/core/concurrency/fair_share_invoker_pool.h index ad3d27783f..794c98d511 100644 --- a/yt/yt/core/concurrency/fair_share_invoker_pool.h +++ b/yt/yt/core/concurrency/fair_share_invoker_pool.h @@ -66,7 +66,7 @@ TDiagnosableInvokerPoolPtr CreateProfiledFairShareInvokerPool( TDuration actionTimeRelevancyHalflife = TAdjustedExponentialMovingAverage::DefaultHalflife, const TString& poolName = "fair_share_invoker_pool", std::vector<TString> bucketNames = {}, - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); //////////////////////////////////////////////////////////////////////////////// @@ -79,7 +79,7 @@ TDiagnosableInvokerPoolPtr CreateEnumIndexedProfiledFairShareInvokerPool( TFairShareCallbackQueueFactory callbackQueueFactory = CreateFairShareCallbackQueue, TDuration actionTimeRelevancyHalflife = TAdjustedExponentialMovingAverage::DefaultHalflife, const TString& poolName = "fair_share_invoker_pool", - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/core/concurrency/fair_share_invoker_queue.cpp b/yt/yt/core/concurrency/fair_share_invoker_queue.cpp index f4c073144a..4f9fb24312 100644 --- a/yt/yt/core/concurrency/fair_share_invoker_queue.cpp +++ b/yt/yt/core/concurrency/fair_share_invoker_queue.cpp @@ -17,7 +17,7 @@ using namespace NYTree; TFairShareInvokerQueue::TFairShareInvokerQueue( TIntrusivePtr<NThreading::TEventCount> callbackEventCount, const std::vector<TBucketDescription>& bucketDescriptions, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) : Weights_(bucketDescriptions.size(), 1.0) { Buckets_.reserve(bucketDescriptions.size()); diff --git a/yt/yt/core/concurrency/fair_share_invoker_queue.h b/yt/yt/core/concurrency/fair_share_invoker_queue.h index 9f18f97ec7..4c75e732e7 100644 --- a/yt/yt/core/concurrency/fair_share_invoker_queue.h +++ b/yt/yt/core/concurrency/fair_share_invoker_queue.h @@ -32,7 +32,7 @@ public: TFairShareInvokerQueue( TIntrusivePtr<NThreading::TEventCount> callbackEventCount, const std::vector<TBucketDescription>& bucketDescriptions, - NProfiling::IRegistryImplPtr registry = {}); + NProfiling::IRegistryPtr registry = {}); ~TFairShareInvokerQueue(); diff --git a/yt/yt/core/concurrency/invoker_queue.cpp b/yt/yt/core/concurrency/invoker_queue.cpp index 849fd8c255..019589501a 100644 --- a/yt/yt/core/concurrency/invoker_queue.cpp +++ b/yt/yt/core/concurrency/invoker_queue.cpp @@ -368,7 +368,7 @@ template <class TQueueImpl> TInvokerQueue<TQueueImpl>::TInvokerQueue( TIntrusivePtr<NThreading::TEventCount> callbackEventCount, const TTagSet& counterTagSet, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) : CallbackEventCount_(std::move(callbackEventCount)) { Counters_.push_back(CreateCounters(counterTagSet, std::move(registry))); @@ -379,7 +379,7 @@ TInvokerQueue<TQueueImpl>::TInvokerQueue( TIntrusivePtr<NThreading::TEventCount> callbackEventCount, const std::vector<TTagSet>& counterTagSets, const std::vector<NYTProf::TProfilerTagPtr>& profilerTags, - NProfiling::IRegistryImplPtr registry) + NProfiling::IRegistryPtr registry) : CallbackEventCount_(std::move(callbackEventCount)) { YT_VERIFY(counterTagSets.size() == profilerTags.size()); @@ -686,7 +686,7 @@ void TInvokerQueue<TQueueImpl>::RegisterWaitTimeObserver(TWaitTimeObserver waitT } template <class TQueueImpl> -typename TInvokerQueue<TQueueImpl>::TCountersPtr TInvokerQueue<TQueueImpl>::CreateCounters(const TTagSet& tagSet, NProfiling::IRegistryImplPtr registry) +typename TInvokerQueue<TQueueImpl>::TCountersPtr TInvokerQueue<TQueueImpl>::CreateCounters(const TTagSet& tagSet, NProfiling::IRegistryPtr registry) { auto profiler = TProfiler(registry, "/action_queue").WithTags(tagSet).WithHot(); diff --git a/yt/yt/core/concurrency/invoker_queue.h b/yt/yt/core/concurrency/invoker_queue.h index d32a5c9cff..e4a978aeae 100644 --- a/yt/yt/core/concurrency/invoker_queue.h +++ b/yt/yt/core/concurrency/invoker_queue.h @@ -128,13 +128,13 @@ public: TInvokerQueue( TIntrusivePtr<NThreading::TEventCount> callbackEventCount, const NProfiling::TTagSet& counterTagSet, - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); TInvokerQueue( TIntrusivePtr<NThreading::TEventCount> callbackEventCount, const std::vector<NProfiling::TTagSet>& counterTagSets, const std::vector<NYTProf::TProfilerTagPtr>& profilerTags, - NProfiling::IRegistryImplPtr registry = nullptr); + NProfiling::IRegistryPtr registry = nullptr); void SetThreadId(NThreading::TThreadId threadId); @@ -223,7 +223,7 @@ private: std::atomic<bool> IsWaitTimeObserverSet_; TWaitTimeObserver WaitTimeObserver_; - TCountersPtr CreateCounters(const NProfiling::TTagSet& tagSet, NProfiling::IRegistryImplPtr registry); + TCountersPtr CreateCounters(const NProfiling::TTagSet& tagSet, NProfiling::IRegistryPtr registry); void TryDrainProducer(bool force = false); }; diff --git a/yt/yt/core/concurrency/unittests/fair_share_action_queue_ut.cpp b/yt/yt/core/concurrency/unittests/fair_share_action_queue_ut.cpp index a60ae66765..d13026ce8d 100644 --- a/yt/yt/core/concurrency/unittests/fair_share_action_queue_ut.cpp +++ b/yt/yt/core/concurrency/unittests/fair_share_action_queue_ut.cpp @@ -9,6 +9,7 @@ #include <yt/yt/core/misc/collection_helpers.h> +#include <yt/yt/library/profiling/solomon/config.h> #include <yt/yt/library/profiling/solomon/exporter.h> #include <util/datetime/base.h> diff --git a/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp b/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp index f7c7604453..1ab289a9e7 100644 --- a/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp +++ b/yt/yt/core/concurrency/unittests/profiled_fair_share_invoker_pool_ut.cpp @@ -12,6 +12,7 @@ #include <yt/yt/core/misc/lazy_ptr.h> +#include <yt/yt/library/profiling/solomon/config.h> #include <yt/yt/library/profiling/solomon/exporter.h> #include <library/cpp/json/yson/json2yson.h> diff --git a/yt/yt/library/profiling/example/main.cpp b/yt/yt/library/profiling/example/main.cpp index 99676e4a12..cb70a0775b 100644 --- a/yt/yt/library/profiling/example/main.cpp +++ b/yt/yt/library/profiling/example/main.cpp @@ -13,6 +13,7 @@ #include <yt/yt/core/misc/ref_counted_tracker_profiler.h> #include <yt/yt/library/profiling/sensor.h> +#include <yt/yt/library/profiling/solomon/config.h> #include <yt/yt/library/profiling/solomon/exporter.h> #include <yt/yt/library/profiling/solomon/registry.h> #include <yt/yt/library/profiling/tcmalloc/profiler.h> diff --git a/yt/yt/library/profiling/impl.cpp b/yt/yt/library/profiling/impl.cpp index c77cebf751..a21ccfbf65 100644 --- a/yt/yt/library/profiling/impl.cpp +++ b/yt/yt/library/profiling/impl.cpp @@ -6,7 +6,7 @@ namespace NYT::NProfiling { //////////////////////////////////////////////////////////////////////////////// -IRegistryImplPtr Y_WEAK GetGlobalRegistry() +Y_WEAK IRegistryPtr GetGlobalRegistry() { return nullptr; } diff --git a/yt/yt/library/profiling/impl.h b/yt/yt/library/profiling/impl.h index 8985a7d244..306551060f 100644 --- a/yt/yt/library/profiling/impl.h +++ b/yt/yt/library/profiling/impl.h @@ -11,61 +11,60 @@ namespace NYT::NProfiling { //////////////////////////////////////////////////////////////////////////////// -struct IRegistryImpl +struct IRegistry : public TRefCounted { -public: - virtual ICounterImplPtr RegisterCounter( + virtual ICounterPtr RegisterCounter( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual ITimeCounterImplPtr RegisterTimeCounter( + virtual ITimeCounterPtr RegisterTimeCounter( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual IGaugeImplPtr RegisterGauge( + virtual IGaugePtr RegisterGauge( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual ITimeGaugeImplPtr RegisterTimeGauge( + virtual ITimeGaugePtr RegisterTimeGauge( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual ISummaryImplPtr RegisterSummary( + virtual ISummaryPtr RegisterSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual IGaugeImplPtr RegisterGaugeSummary( + virtual IGaugePtr RegisterGaugeSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual ITimeGaugeImplPtr RegisterTimeGaugeSummary( + virtual ITimeGaugePtr RegisterTimeGaugeSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual ITimerImplPtr RegisterTimerSummary( + virtual ITimerPtr RegisterTimerSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual ITimerImplPtr RegisterTimeHistogram( + virtual ITimerPtr RegisterTimeHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual IHistogramImplPtr RegisterGaugeHistogram( + virtual IHistogramPtr RegisterGaugeHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; - virtual IHistogramImplPtr RegisterRateHistogram( + virtual IHistogramPtr RegisterRateHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) = 0; @@ -96,24 +95,24 @@ public: const std::string& value) = 0; }; -DEFINE_REFCOUNTED_TYPE(IRegistryImpl) +DEFINE_REFCOUNTED_TYPE(IRegistry) -IRegistryImplPtr GetGlobalRegistry(); +IRegistryPtr GetGlobalRegistry(); //////////////////////////////////////////////////////////////////////////////// -struct ICounterImpl +struct ICounter : public TRefCounted { virtual void Increment(i64 delta) = 0; virtual i64 GetValue() = 0; }; -DEFINE_REFCOUNTED_TYPE(ICounterImpl) +DEFINE_REFCOUNTED_TYPE(ICounter) //////////////////////////////////////////////////////////////////////////////// -struct ITimeCounterImpl +struct ITimeCounter : public TRefCounted { virtual void Add(TDuration delta) = 0; @@ -121,34 +120,34 @@ struct ITimeCounterImpl virtual TDuration GetValue() = 0; }; -DEFINE_REFCOUNTED_TYPE(ITimeCounterImpl) +DEFINE_REFCOUNTED_TYPE(ITimeCounter) //////////////////////////////////////////////////////////////////////////////// -struct IGaugeImpl +struct IGauge : public virtual TRefCounted { virtual void Update(double value) = 0; virtual double GetValue() = 0; }; -DEFINE_REFCOUNTED_TYPE(IGaugeImpl) +DEFINE_REFCOUNTED_TYPE(IGauge) //////////////////////////////////////////////////////////////////////////////// -struct ITimeGaugeImpl +struct ITimeGauge : public virtual TRefCounted { virtual void Update(TDuration value) = 0; virtual TDuration GetValue() = 0; }; -DEFINE_REFCOUNTED_TYPE(ITimeGaugeImpl) +DEFINE_REFCOUNTED_TYPE(ITimeGauge) //////////////////////////////////////////////////////////////////////////////// template <class T> -struct ISummaryImplBase +struct ISummaryBase : public virtual TRefCounted { virtual void Record(T value) = 0; @@ -157,12 +156,12 @@ struct ISummaryImplBase virtual TSummarySnapshot<T> GetSummaryAndReset() = 0; }; -DEFINE_REFCOUNTED_TYPE(ISummaryImpl) -DEFINE_REFCOUNTED_TYPE(ITimerImpl) +DEFINE_REFCOUNTED_TYPE(ISummary) +DEFINE_REFCOUNTED_TYPE(ITimer) //////////////////////////////////////////////////////////////////////////////// -struct IHistogramImpl +struct IHistogram : public virtual TRefCounted { virtual void Add(double value, int count) = 0; @@ -173,7 +172,7 @@ struct IHistogramImpl virtual void LoadSnapshot(THistogramSnapshot snapshot) = 0; }; -DEFINE_REFCOUNTED_TYPE(IHistogramImpl) +DEFINE_REFCOUNTED_TYPE(IHistogram) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/library/profiling/public.h b/yt/yt/library/profiling/public.h index db42520669..1602651c64 100644 --- a/yt/yt/library/profiling/public.h +++ b/yt/yt/library/profiling/public.h @@ -9,21 +9,23 @@ namespace NYT::NProfiling { //////////////////////////////////////////////////////////////////////////////// template <class T> -struct ISummaryImplBase; +struct ISummaryBase; -using ISummaryImpl = ISummaryImplBase<double>; -using ITimerImpl = ISummaryImplBase<TDuration>; +using ISummary = ISummaryBase<double>; +using ITimer = ISummaryBase<TDuration>; -DECLARE_REFCOUNTED_TYPE(ISummaryImpl) -DECLARE_REFCOUNTED_TYPE(ITimerImpl) +DECLARE_REFCOUNTED_TYPE(ISummary) +DECLARE_REFCOUNTED_TYPE(ITimer) -DECLARE_REFCOUNTED_STRUCT(ICounterImpl) -DECLARE_REFCOUNTED_STRUCT(ITimeCounterImpl) -DECLARE_REFCOUNTED_STRUCT(IGaugeImpl) -DECLARE_REFCOUNTED_STRUCT(ITimeGaugeImpl) -DECLARE_REFCOUNTED_STRUCT(IHistogramImpl) -DECLARE_REFCOUNTED_STRUCT(IRegistryImpl) +DECLARE_REFCOUNTED_STRUCT(ICounter) +DECLARE_REFCOUNTED_STRUCT(ITimeCounter) +DECLARE_REFCOUNTED_STRUCT(IGauge) +DECLARE_REFCOUNTED_STRUCT(ITimeGauge) +DECLARE_REFCOUNTED_STRUCT(IHistogram) + +DECLARE_REFCOUNTED_STRUCT(IRegistry) DECLARE_REFCOUNTED_STRUCT(ISensorProducer) + DECLARE_REFCOUNTED_CLASS(TBufferedProducer) //////////////////////////////////////////////////////////////////////////////// diff --git a/yt/yt/library/profiling/sensor.cpp b/yt/yt/library/profiling/sensor.cpp index f795a01c91..79ce55b97d 100644 --- a/yt/yt/library/profiling/sensor.cpp +++ b/yt/yt/library/profiling/sensor.cpp @@ -262,23 +262,23 @@ bool TSensorOptions::IsCompatibleWith(const TSensorOptions& other) const namespace NDetail { template <bool UseWeakPtr> -TRegistryHolderBase<UseWeakPtr>::TRegistryHolderBase(const IRegistryImplPtr& impl) +TRegistryHolderBase<UseWeakPtr>::TRegistryHolderBase(const IRegistryPtr& impl) : Impl_(impl) { } template <bool UseWeakPtr> -const IRegistryImplPtr& TRegistryHolderBase<UseWeakPtr>::GetRegistry() const +const IRegistryPtr& TRegistryHolderBase<UseWeakPtr>::GetRegistry() const { return Impl_; } //////////////////////////////////////////////////////////////////////////////// -TRegistryHolderBase<true>::TRegistryHolderBase(const IRegistryImplPtr& impl) +TRegistryHolderBase<true>::TRegistryHolderBase(const IRegistryPtr& impl) : Impl_(impl) { } -IRegistryImplPtr TRegistryHolderBase<true>::GetRegistry() const +IRegistryPtr TRegistryHolderBase<true>::GetRegistry() const { return Impl_.Lock(); } @@ -294,7 +294,7 @@ template class TRegistryHolderBase<false>; template <bool UseWeakPtr> TProfiler<UseWeakPtr>::TProfiler( - const IRegistryImplPtr& impl, + const IRegistryPtr& impl, const std::string& prefix, const std::string& _namespace) : TBase(impl) @@ -308,7 +308,7 @@ TProfiler<UseWeakPtr>::TProfiler( const std::string& prefix, const std::string& _namespace, const TTagSet& tags, - const IRegistryImplPtr& impl, + const IRegistryPtr& impl, TSensorOptions options) : TBase(impl ? impl : GetGlobalRegistry()) , Enabled_(true) diff --git a/yt/yt/library/profiling/sensor.h b/yt/yt/library/profiling/sensor.h index c1cfa9e4c4..8272e944ce 100644 --- a/yt/yt/library/profiling/sensor.h +++ b/yt/yt/library/profiling/sensor.h @@ -52,7 +52,7 @@ private: friend class NDetail::TProfiler; friend struct TTesting; - ICounterImplPtr Counter_; + ICounterPtr Counter_; }; //////////////////////////////////////////////////////////////////////////////// @@ -69,7 +69,7 @@ private: friend class NDetail::TProfiler; friend struct TTesting; - ITimeCounterImplPtr Counter_; + ITimeCounterPtr Counter_; }; //////////////////////////////////////////////////////////////////////////////// @@ -86,7 +86,7 @@ private: friend class NDetail::TProfiler; friend struct TTesting; - IGaugeImplPtr Gauge_; + IGaugePtr Gauge_; }; //////////////////////////////////////////////////////////////////////////////// @@ -103,7 +103,7 @@ private: friend class NDetail::TProfiler; friend struct TTesting; - ITimeGaugeImplPtr Gauge_; + ITimeGaugePtr Gauge_; }; //////////////////////////////////////////////////////////////////////////////// @@ -119,7 +119,7 @@ private: template <bool> friend class NDetail::TProfiler; - ISummaryImplPtr Summary_; + ISummaryPtr Summary_; }; //////////////////////////////////////////////////////////////////////////////// @@ -135,7 +135,7 @@ private: template <bool> friend class NDetail::TProfiler; - ITimerImplPtr Timer_; + ITimerPtr Timer_; }; //////////////////////////////////////////////////////////////////////////////// @@ -174,7 +174,7 @@ private: template <bool> friend class NDetail::TProfiler; - IHistogramImplPtr Histogram_; + IHistogramPtr Histogram_; }; //////////////////////////////////////////////////////////////////////////////// @@ -191,7 +191,7 @@ private: friend class NDetail::TProfiler; friend struct TTesting; - IHistogramImplPtr Histogram_; + IHistogramPtr Histogram_; }; //////////////////////////////////////////////////////////////////////////////// @@ -252,12 +252,12 @@ template <bool UseWeakPtr> class TRegistryHolderBase { public: - explicit TRegistryHolderBase(const IRegistryImplPtr& impl = nullptr); + explicit TRegistryHolderBase(const IRegistryPtr& impl = nullptr); - const IRegistryImplPtr& GetRegistry() const; + const IRegistryPtr& GetRegistry() const; private: - IRegistryImplPtr Impl_; + IRegistryPtr Impl_; }; //////////////////////////////////////////////////////////////////////////////// @@ -266,12 +266,12 @@ template <> class TRegistryHolderBase<true> { public: - explicit TRegistryHolderBase(const IRegistryImplPtr& impl = nullptr); + explicit TRegistryHolderBase(const IRegistryPtr& impl = nullptr); - IRegistryImplPtr GetRegistry() const; + IRegistryPtr GetRegistry() const; private: - TWeakPtr<IRegistryImpl> Impl_; + TWeakPtr<IRegistry> Impl_; }; //////////////////////////////////////////////////////////////////////////////// @@ -301,7 +301,7 @@ public: static constexpr auto DefaultNamespace = "yt"; TProfiler( - const IRegistryImplPtr& impl, + const IRegistryPtr& impl, const std::string& prefix, const std::string& _namespace = DefaultNamespace); @@ -309,7 +309,7 @@ public: const std::string& prefix, const std::string& _namespace = DefaultNamespace, const TTagSet& tags = {}, - const IRegistryImplPtr& impl = nullptr, + const IRegistryPtr& impl = nullptr, TSensorOptions options = {}); TProfiler WithPrefix(const std::string& prefix) const; diff --git a/yt/yt/library/profiling/solomon/config.cpp b/yt/yt/library/profiling/solomon/config.cpp new file mode 100644 index 0000000000..84c4bf2308 --- /dev/null +++ b/yt/yt/library/profiling/solomon/config.cpp @@ -0,0 +1,167 @@ +#include "config.h" + +#include "private.h" + +namespace NYT::NProfiling { + +//////////////////////////////////////////////////////////////////////////////// + +void TShardConfig::Register(TRegistrar registrar) +{ + registrar.Parameter("filter", &TThis::Filter) + .Default(); + + registrar.Parameter("grid_step", &TThis::GridStep) + .Default(); +} + +//////////////////////////////////////////////////////////////////////////////// + +void TSolomonExporterConfig::Register(TRegistrar registrar) +{ + registrar.Parameter("grid_step", &TThis::GridStep) + .Default(TDuration::Seconds(5)); + + registrar.Parameter("linger_timeout", &TThis::LingerTimeout) + .Default(TDuration::Minutes(5)); + + registrar.Parameter("window_size", &TThis::WindowSize) + .Default(12); + + registrar.Parameter("thread_pool_size", &TThis::ThreadPoolSize) + .Default(1); + registrar.Parameter("encoding_thread_pool_size", &TThis::EncodingThreadPoolSize) + .Default(1); + registrar.Parameter("thread_pool_polling_period", &TThis::ThreadPoolPollingPeriod) + .Default(TDuration::MilliSeconds(10)); + registrar.Parameter("encoding_thread_pool_polling_period", &TThis::EncodingThreadPoolPollingPeriod) + .Default(TDuration::MilliSeconds(10)); + + registrar.Parameter("convert_counters_to_rate_for_solomon", &TThis::ConvertCountersToRateForSolomon) + .Alias("convert_counters_to_rate") + .Default(true); + registrar.Parameter("rename_converted_counters", &TThis::RenameConvertedCounters) + .Default(true); + registrar.Parameter("convert_counters_to_delta_gauge", &TThis::ConvertCountersToDeltaGauge) + .Default(false); + + registrar.Parameter("export_summary", &TThis::ExportSummary) + .Default(false); + registrar.Parameter("export_summary_as_max", &TThis::ExportSummaryAsMax) + .Default(true); + registrar.Parameter("export_summary_as_avg", &TThis::ExportSummaryAsAvg) + .Default(false); + + registrar.Parameter("mark_aggregates", &TThis::MarkAggregates) + .Default(true); + + registrar.Parameter("strip_sensors_name_prefix", &TThis::StripSensorsNamePrefix) + .Default(false); + + registrar.Parameter("enable_self_profiling", &TThis::EnableSelfProfiling) + .Default(true); + + registrar.Parameter("report_build_info", &TThis::ReportBuildInfo) + .Default(true); + + registrar.Parameter("report_kernel_version", &TThis::ReportKernelVersion) + .Default(true); + + registrar.Parameter("report_restart", &TThis::ReportRestart) + .Default(true); + + registrar.Parameter("read_delay", &TThis::ReadDelay) + .Default(TDuration::Seconds(5)); + + registrar.Parameter("host", &TThis::Host) + .Default(); + + registrar.Parameter("instance_tags", &TThis::InstanceTags) + .Default(); + + registrar.Parameter("shards", &TThis::Shards) + .Default(); + + registrar.Parameter("response_cache_ttl", &TThis::ResponseCacheTtl) + .Default(TDuration::Minutes(2)); + + registrar.Parameter("update_sensor_service_tree_period", &TThis::UpdateSensorServiceTreePeriod) + .Default(TDuration::Seconds(30)); + + registrar.Parameter("producer_collection_batch_size", &TThis::ProducerCollectionBatchSize) + .Default(DefaultProducerCollectionBatchSize) + .GreaterThan(0); + + registrar.Postprocessor([] (TThis* config) { + if (config->LingerTimeout.GetValue() % config->GridStep.GetValue() != 0) { + THROW_ERROR_EXCEPTION("\"linger_timeout\" must be multiple of \"grid_step\""); + } + }); + + registrar.Postprocessor([] (TThis* config) { + if (config->ConvertCountersToRateForSolomon && config->ConvertCountersToDeltaGauge) { + THROW_ERROR_EXCEPTION("\"convert_counters_to_rate_for_solomon\" and \"convert_counters_to_delta_gauge\" both set to true"); + } + }); + + registrar.Postprocessor([] (TThis* config) { + for (const auto& [name, shard] : config->Shards) { + if (!shard->GridStep) { + continue; + } + + if (shard->GridStep < config->GridStep) { + THROW_ERROR_EXCEPTION("shard \"grid_step\" must be greater than global \"grid_step\""); + } + + if (shard->GridStep->GetValue() % config->GridStep.GetValue() != 0) { + THROW_ERROR_EXCEPTION("shard \"grid_step\" must be multiple of global \"grid_step\""); + } + + if (config->LingerTimeout.GetValue() % shard->GridStep->GetValue() != 0) { + THROW_ERROR_EXCEPTION("\"linger_timeout\" must be multiple shard \"grid_step\""); + } + } + }); +} + +TShardConfigPtr TSolomonExporterConfig::MatchShard(const std::string& sensorName) +{ + TShardConfigPtr matchedShard; + int matchSize = -1; + + for (const auto& [name, config] : Shards) { + for (auto prefix : config->Filter) { + if (!sensorName.starts_with(prefix)) { + continue; + } + + if (static_cast<int>(prefix.size()) > matchSize) { + matchSize = prefix.size(); + matchedShard = config; + } + } + } + + return matchedShard; +} + +ESummaryPolicy TSolomonExporterConfig::GetSummaryPolicy() const +{ + auto policy = ESummaryPolicy::Default; + if (ExportSummary) { + policy |= ESummaryPolicy::All; + } + if (ExportSummaryAsMax) { + policy |= ESummaryPolicy::Max; + } + if (ExportSummaryAsAvg) { + policy |= ESummaryPolicy::Avg; + } + + return policy; +} + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT::NProfiling diff --git a/yt/yt/library/profiling/solomon/config.h b/yt/yt/library/profiling/solomon/config.h new file mode 100644 index 0000000000..0c36c1120d --- /dev/null +++ b/yt/yt/library/profiling/solomon/config.h @@ -0,0 +1,90 @@ +#pragma once + +#include "public.h" + +#include <yt/yt/core/ytree/yson_struct.h> + +namespace NYT::NProfiling { + +//////////////////////////////////////////////////////////////////////////////// + +struct TShardConfig + : public NYTree::TYsonStruct +{ + std::vector<std::string> Filter; + + std::optional<TDuration> GridStep; + + REGISTER_YSON_STRUCT(TShardConfig); + + static void Register(TRegistrar registrar); +}; + +DEFINE_REFCOUNTED_TYPE(TShardConfig) + +//////////////////////////////////////////////////////////////////////////////// + +struct TSolomonExporterConfig + : public NYTree::TYsonStruct +{ + TDuration GridStep; + + TDuration LingerTimeout; + + int WindowSize; + + int ThreadPoolSize; + int EncodingThreadPoolSize; + TDuration ThreadPoolPollingPeriod; + TDuration EncodingThreadPoolPollingPeriod; + + bool ConvertCountersToRateForSolomon; + bool RenameConvertedCounters; + bool ConvertCountersToDeltaGauge; + + bool ExportSummary; + bool ExportSummaryAsMax; + bool ExportSummaryAsAvg; + + bool MarkAggregates; + + bool StripSensorsNamePrefix; + + bool EnableCoreProfilingCompatibility; + + bool EnableSelfProfiling; + + bool ReportBuildInfo; + + bool ReportKernelVersion; + + bool ReportRestart; + + TDuration ResponseCacheTtl; + + TDuration ReadDelay; + + std::optional<std::string> Host; + + THashMap<std::string, std::string> InstanceTags; + + THashMap<std::string, TShardConfigPtr> Shards; + + TDuration UpdateSensorServiceTreePeriod; + + int ProducerCollectionBatchSize; + + TShardConfigPtr MatchShard(const std::string& sensorName); + + ESummaryPolicy GetSummaryPolicy() const; + + REGISTER_YSON_STRUCT(TSolomonExporterConfig); + + static void Register(TRegistrar registrar); +}; + +DEFINE_REFCOUNTED_TYPE(TSolomonExporterConfig) + +//////////////////////////////////////////////////////////////////////////////// + +} // namespace NYT::NProfiling diff --git a/yt/yt/library/profiling/solomon/exporter.cpp b/yt/yt/library/profiling/solomon/exporter.cpp index 225f7682ff..d039924ab5 100644 --- a/yt/yt/library/profiling/solomon/exporter.cpp +++ b/yt/yt/library/profiling/solomon/exporter.cpp @@ -1,4 +1,6 @@ #include "exporter.h" + +#include "config.h" #include "private.h" #include "sensor_service.h" #include "helpers.h" @@ -43,164 +45,6 @@ static constexpr auto& Logger = SolomonLogger; //////////////////////////////////////////////////////////////////////////////// -void TShardConfig::Register(TRegistrar registrar) -{ - registrar.Parameter("filter", &TThis::Filter) - .Default(); - - registrar.Parameter("grid_step", &TThis::GridStep) - .Default(); -} - -//////////////////////////////////////////////////////////////////////////////// - -void TSolomonExporterConfig::Register(TRegistrar registrar) -{ - registrar.Parameter("grid_step", &TThis::GridStep) - .Default(TDuration::Seconds(5)); - - registrar.Parameter("linger_timeout", &TThis::LingerTimeout) - .Default(TDuration::Minutes(5)); - - registrar.Parameter("window_size", &TThis::WindowSize) - .Default(12); - - registrar.Parameter("thread_pool_size", &TThis::ThreadPoolSize) - .Default(1); - registrar.Parameter("encoding_thread_pool_size", &TThis::EncodingThreadPoolSize) - .Default(1); - registrar.Parameter("thread_pool_polling_period", &TThis::ThreadPoolPollingPeriod) - .Default(TDuration::MilliSeconds(10)); - registrar.Parameter("encoding_thread_pool_polling_period", &TThis::EncodingThreadPoolPollingPeriod) - .Default(TDuration::MilliSeconds(10)); - - registrar.Parameter("convert_counters_to_rate_for_solomon", &TThis::ConvertCountersToRateForSolomon) - .Alias("convert_counters_to_rate") - .Default(true); - registrar.Parameter("rename_converted_counters", &TThis::RenameConvertedCounters) - .Default(true); - registrar.Parameter("convert_counters_to_delta_gauge", &TThis::ConvertCountersToDeltaGauge) - .Default(false); - - registrar.Parameter("export_summary", &TThis::ExportSummary) - .Default(false); - registrar.Parameter("export_summary_as_max", &TThis::ExportSummaryAsMax) - .Default(true); - registrar.Parameter("export_summary_as_avg", &TThis::ExportSummaryAsAvg) - .Default(false); - - registrar.Parameter("mark_aggregates", &TThis::MarkAggregates) - .Default(true); - - registrar.Parameter("strip_sensors_name_prefix", &TThis::StripSensorsNamePrefix) - .Default(false); - - registrar.Parameter("enable_self_profiling", &TThis::EnableSelfProfiling) - .Default(true); - - registrar.Parameter("report_build_info", &TThis::ReportBuildInfo) - .Default(true); - - registrar.Parameter("report_kernel_version", &TThis::ReportKernelVersion) - .Default(true); - - registrar.Parameter("report_restart", &TThis::ReportRestart) - .Default(true); - - registrar.Parameter("read_delay", &TThis::ReadDelay) - .Default(TDuration::Seconds(5)); - - registrar.Parameter("host", &TThis::Host) - .Default(); - - registrar.Parameter("instance_tags", &TThis::InstanceTags) - .Default(); - - registrar.Parameter("shards", &TThis::Shards) - .Default(); - - registrar.Parameter("response_cache_ttl", &TThis::ResponseCacheTtl) - .Default(TDuration::Minutes(2)); - - registrar.Parameter("update_sensor_service_tree_period", &TThis::UpdateSensorServiceTreePeriod) - .Default(TDuration::Seconds(30)); - - registrar.Parameter("producer_collection_batch_size", &TThis::ProducerCollectionBatchSize) - .Default(DefaultProducerCollectionBatchSize) - .GreaterThan(0); - - registrar.Postprocessor([] (TThis* config) { - if (config->LingerTimeout.GetValue() % config->GridStep.GetValue() != 0) { - THROW_ERROR_EXCEPTION("\"linger_timeout\" must be multiple of \"grid_step\""); - } - }); - - registrar.Postprocessor([] (TThis* config) { - if (config->ConvertCountersToRateForSolomon && config->ConvertCountersToDeltaGauge) { - THROW_ERROR_EXCEPTION("\"convert_counters_to_rate_for_solomon\" and \"convert_counters_to_delta_gauge\" both set to true"); - } - }); - - registrar.Postprocessor([] (TThis* config) { - for (const auto& [name, shard] : config->Shards) { - if (!shard->GridStep) { - continue; - } - - if (shard->GridStep < config->GridStep) { - THROW_ERROR_EXCEPTION("shard \"grid_step\" must be greater than global \"grid_step\""); - } - - if (shard->GridStep->GetValue() % config->GridStep.GetValue() != 0) { - THROW_ERROR_EXCEPTION("shard \"grid_step\" must be multiple of global \"grid_step\""); - } - - if (config->LingerTimeout.GetValue() % shard->GridStep->GetValue() != 0) { - THROW_ERROR_EXCEPTION("\"linger_timeout\" must be multiple shard \"grid_step\""); - } - } - }); -} - -TShardConfigPtr TSolomonExporterConfig::MatchShard(const std::string& sensorName) -{ - TShardConfigPtr matchedShard; - int matchSize = -1; - - for (const auto& [name, config] : Shards) { - for (auto prefix : config->Filter) { - if (!sensorName.starts_with(prefix)) { - continue; - } - - if (static_cast<int>(prefix.size()) > matchSize) { - matchSize = prefix.size(); - matchedShard = config; - } - } - } - - return matchedShard; -} - -ESummaryPolicy TSolomonExporterConfig::GetSummaryPolicy() const -{ - auto policy = ESummaryPolicy::Default; - if (ExportSummary) { - policy |= ESummaryPolicy::All; - } - if (ExportSummaryAsMax) { - policy |= ESummaryPolicy::Max; - } - if (ExportSummaryAsAvg) { - policy |= ESummaryPolicy::Avg; - } - - return policy; -} - -//////////////////////////////////////////////////////////////////////////////// - TSolomonExporter::TSolomonExporter( TSolomonExporterConfigPtr config, TSolomonRegistryPtr registry) diff --git a/yt/yt/library/profiling/solomon/exporter.h b/yt/yt/library/profiling/solomon/exporter.h index 46bb7f37cb..d8bee70b3b 100644 --- a/yt/yt/library/profiling/solomon/exporter.h +++ b/yt/yt/library/profiling/solomon/exporter.h @@ -12,7 +12,6 @@ #include <yt/yt/core/http/public.h> #include <yt/yt/core/ytree/ypath_detail.h> -#include <yt/yt/core/ytree/yson_struct.h> #include <yt/yt/library/profiling/producer.h> #include <yt/yt/library/profiling/sensor.h> @@ -23,85 +22,6 @@ namespace NYT::NProfiling { //////////////////////////////////////////////////////////////////////////////// -struct TShardConfig - : public NYTree::TYsonStruct -{ - std::vector<std::string> Filter; - - std::optional<TDuration> GridStep; - - REGISTER_YSON_STRUCT(TShardConfig); - - static void Register(TRegistrar registrar); -}; - -DEFINE_REFCOUNTED_TYPE(TShardConfig) - -//////////////////////////////////////////////////////////////////////////////// - -struct TSolomonExporterConfig - : public NYTree::TYsonStruct -{ - TDuration GridStep; - - TDuration LingerTimeout; - - int WindowSize; - - int ThreadPoolSize; - int EncodingThreadPoolSize; - TDuration ThreadPoolPollingPeriod; - TDuration EncodingThreadPoolPollingPeriod; - - bool ConvertCountersToRateForSolomon; - bool RenameConvertedCounters; - bool ConvertCountersToDeltaGauge; - - bool ExportSummary; - bool ExportSummaryAsMax; - bool ExportSummaryAsAvg; - - bool MarkAggregates; - - bool StripSensorsNamePrefix; - - bool EnableCoreProfilingCompatibility; - - bool EnableSelfProfiling; - - bool ReportBuildInfo; - - bool ReportKernelVersion; - - bool ReportRestart; - - TDuration ResponseCacheTtl; - - TDuration ReadDelay; - - std::optional<std::string> Host; - - THashMap<std::string, std::string> InstanceTags; - - THashMap<std::string, TShardConfigPtr> Shards; - - TDuration UpdateSensorServiceTreePeriod; - - int ProducerCollectionBatchSize; - - TShardConfigPtr MatchShard(const std::string& sensorName); - - ESummaryPolicy GetSummaryPolicy() const; - - REGISTER_YSON_STRUCT(TSolomonExporterConfig); - - static void Register(TRegistrar registrar); -}; - -DEFINE_REFCOUNTED_TYPE(TSolomonExporterConfig) - -//////////////////////////////////////////////////////////////////////////////// - class TSolomonExporter : public TRefCounted { diff --git a/yt/yt/library/profiling/solomon/percpu.h b/yt/yt/library/profiling/solomon/percpu.h index e6e3be2a05..49e414ba79 100644 --- a/yt/yt/library/profiling/solomon/percpu.h +++ b/yt/yt/library/profiling/solomon/percpu.h @@ -12,7 +12,7 @@ namespace NYT::NProfiling { //////////////////////////////////////////////////////////////////////////////// class TPerCpuCounter - : public ICounterImpl + : public ICounter { public: void Increment(i64 delta) override; @@ -33,7 +33,7 @@ static_assert(sizeof(TPerCpuCounter) == 64 + 64 * 64); //////////////////////////////////////////////////////////////////////////////// class TPerCpuTimeCounter - : public ITimeCounterImpl + : public ITimeCounter { public: void Add(TDuration delta) override; @@ -54,7 +54,7 @@ static_assert(sizeof(TPerCpuCounter) == 64 + 64 * 64); //////////////////////////////////////////////////////////////////////////////// class TPerCpuGauge - : public IGaugeImpl + : public IGauge { public: void Update(double value) override; @@ -94,7 +94,7 @@ static_assert(sizeof(TPerCpuCounter) == 64 + 64 * 64); template <class T> class TPerCpuSummary - : public ISummaryImplBase<T> + : public ISummaryBase<T> { public: void Record(T value) override; diff --git a/yt/yt/library/profiling/solomon/producer.cpp b/yt/yt/library/profiling/solomon/producer.cpp index 7e52b95fdb..494a31cea0 100644 --- a/yt/yt/library/profiling/solomon/producer.cpp +++ b/yt/yt/library/profiling/solomon/producer.cpp @@ -65,7 +65,7 @@ bool TProducerCounters::IsEmpty() const //////////////////////////////////////////////////////////////////////////////// TCounterWriter::TCounterWriter( - IRegistryImplPtr registry, + IRegistryPtr registry, TProducerCountersPtr counters, i64 iteration) : Registry_(std::move(registry)) @@ -150,7 +150,7 @@ struct TOwningProducer }; void DoCollectBatch( - const IRegistryImplPtr& profiler, + const IRegistryPtr& profiler, std::vector<TOwningProducer>&& batchArg, const TEventTimer& collectDuration) { @@ -186,7 +186,7 @@ void DoCollectBatch( TFuture<void> CollectBatchAsync( const IInvokerPtr& invoker, - const IRegistryImplPtr& profiler, + const IRegistryPtr& profiler, std::vector<TOwningProducer>&& batch, const TEventTimer& collectDuration) { @@ -200,7 +200,7 @@ void TProducerSet::AddProducer(TProducerStatePtr state) Producers_.insert(std::move(state)); } -void TProducerSet::Collect(IRegistryImplPtr profiler, IInvokerPtr invoker) +void TProducerSet::Collect(IRegistryPtr profiler, IInvokerPtr invoker) { std::vector<TFuture<void>> offloadFutures; std::deque<TProducerStatePtr> toRemove; diff --git a/yt/yt/library/profiling/solomon/producer.h b/yt/yt/library/profiling/solomon/producer.h index a6db1f1ff7..77c5d7e475 100644 --- a/yt/yt/library/profiling/solomon/producer.h +++ b/yt/yt/library/profiling/solomon/producer.h @@ -32,7 +32,7 @@ class TCounterWriter final { public: TCounterWriter( - IRegistryImplPtr registry, + IRegistryPtr registry, TProducerCountersPtr counters, i64 iteration); @@ -42,7 +42,7 @@ public: void AddCounter(const std::string& name, i64 value) override; private: - IRegistryImplPtr Registry_; + IRegistryPtr Registry_; std::vector<TProducerCountersPtr> Counters_; i64 Iteration_; }; @@ -80,7 +80,7 @@ class TProducerSet public: void AddProducer(TProducerStatePtr state); - void Collect(IRegistryImplPtr profiler, IInvokerPtr invoker); + void Collect(IRegistryPtr profiler, IInvokerPtr invoker); void Profile(const TWeakProfiler& profiler); diff --git a/yt/yt/library/profiling/solomon/registry.cpp b/yt/yt/library/profiling/solomon/registry.cpp index 737355912f..0aa629516f 100644 --- a/yt/yt/library/profiling/solomon/registry.cpp +++ b/yt/yt/library/profiling/solomon/registry.cpp @@ -33,12 +33,12 @@ TIntrusivePtr<TBase> SelectImpl(bool hot, const TFn& fn) } } -ICounterImplPtr TSolomonRegistry::RegisterCounter( +ICounterPtr TSolomonRegistry::RegisterCounter( const std::string& name, const TTagSet& tags, TSensorOptions options) { - return SelectImpl<ICounterImpl, TSimpleCounter, TPerCpuCounter>(options.Hot, [&, this] (const auto& counter) { + return SelectImpl<ICounter, TSimpleCounter, TPerCpuCounter>(options.Hot, [&, this] (const auto& counter) { DoRegister([this, name, tags, options = std::move(options), counter] { auto reader = [ptr = counter.Get()] { return ptr->GetValue(); @@ -50,12 +50,12 @@ ICounterImplPtr TSolomonRegistry::RegisterCounter( }); } -ITimeCounterImplPtr TSolomonRegistry::RegisterTimeCounter( +ITimeCounterPtr TSolomonRegistry::RegisterTimeCounter( const std::string& name, const TTagSet& tags, TSensorOptions options) { - return SelectImpl<ITimeCounterImpl, TSimpleTimeCounter, TPerCpuTimeCounter>( + return SelectImpl<ITimeCounter, TSimpleTimeCounter, TPerCpuTimeCounter>( options.Hot, [&, this] (const auto& counter) { DoRegister([this, name, tags, options = std::move(options), counter] { @@ -65,12 +65,12 @@ ITimeCounterImplPtr TSolomonRegistry::RegisterTimeCounter( }); } -IGaugeImplPtr TSolomonRegistry::RegisterGauge( +IGaugePtr TSolomonRegistry::RegisterGauge( const std::string& name, const TTagSet& tags, TSensorOptions options) { - return SelectImpl<IGaugeImpl, TSimpleGauge, TPerCpuGauge>(options.Hot, [&, this] (const auto& gauge) { + return SelectImpl<IGauge, TSimpleGauge, TPerCpuGauge>(options.Hot, [&, this] (const auto& gauge) { if (options.DisableDefault) { gauge->Update(std::numeric_limits<double>::quiet_NaN()); } @@ -86,7 +86,7 @@ IGaugeImplPtr TSolomonRegistry::RegisterGauge( }); } -ITimeGaugeImplPtr TSolomonRegistry::RegisterTimeGauge( +ITimeGaugePtr TSolomonRegistry::RegisterTimeGauge( const std::string& name, const TTagSet& tags, TSensorOptions options) @@ -105,12 +105,12 @@ ITimeGaugeImplPtr TSolomonRegistry::RegisterTimeGauge( return gauge; } -ISummaryImplPtr TSolomonRegistry::RegisterSummary( +ISummaryPtr TSolomonRegistry::RegisterSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) { - return SelectImpl<ISummaryImpl, TSimpleSummary<double>, TPerCpuSummary<double>>(options.Hot, [&, this] (const auto& summary) { + return SelectImpl<ISummary, TSimpleSummary<double>, TPerCpuSummary<double>>(options.Hot, [&, this] (const auto& summary) { DoRegister([this, name, tags, options = std::move(options), summary] { auto set = FindSet(name, options); set->AddSummary(New<TSummaryState>(summary, Tags_.Encode(tags), tags)); @@ -118,7 +118,7 @@ ISummaryImplPtr TSolomonRegistry::RegisterSummary( }); } -IGaugeImplPtr TSolomonRegistry::RegisterGaugeSummary( +IGaugePtr TSolomonRegistry::RegisterGaugeSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) @@ -132,7 +132,7 @@ IGaugeImplPtr TSolomonRegistry::RegisterGaugeSummary( return gauge; } -ITimeGaugeImplPtr TSolomonRegistry::RegisterTimeGaugeSummary( +ITimeGaugePtr TSolomonRegistry::RegisterTimeGaugeSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) @@ -146,12 +146,12 @@ ITimeGaugeImplPtr TSolomonRegistry::RegisterTimeGaugeSummary( return gauge; } -ITimerImplPtr TSolomonRegistry::RegisterTimerSummary( +ITimerPtr TSolomonRegistry::RegisterTimerSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) { - return SelectImpl<ITimerImpl, TSimpleSummary<TDuration>, TPerCpuSummary<TDuration>>( + return SelectImpl<ITimer, TSimpleSummary<TDuration>, TPerCpuSummary<TDuration>>( options.Hot, [&, this] (const auto& timer) { DoRegister([this, name, tags, options = std::move(options), timer] { @@ -161,7 +161,7 @@ ITimerImplPtr TSolomonRegistry::RegisterTimerSummary( }); } -ITimerImplPtr TSolomonRegistry::RegisterTimeHistogram( +ITimerPtr TSolomonRegistry::RegisterTimeHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) @@ -174,7 +174,7 @@ ITimerImplPtr TSolomonRegistry::RegisterTimeHistogram( return hist; } -IHistogramImplPtr TSolomonRegistry::RegisterGaugeHistogram( +IHistogramPtr TSolomonRegistry::RegisterGaugeHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) @@ -187,7 +187,7 @@ IHistogramImplPtr TSolomonRegistry::RegisterGaugeHistogram( return hist; } -IHistogramImplPtr TSolomonRegistry::RegisterRateHistogram( +IHistogramPtr TSolomonRegistry::RegisterRateHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) @@ -563,7 +563,7 @@ NProto::TSensorDump TSolomonRegistry::DumpSensors(const std::optional<std::strin #ifdef _unix_ // This function overrides weak symbol defined in impl.cpp -IRegistryImplPtr GetGlobalRegistry() +IRegistryPtr GetGlobalRegistry() { return TSolomonRegistry::Get(); } diff --git a/yt/yt/library/profiling/solomon/registry.h b/yt/yt/library/profiling/solomon/registry.h index af99e8c2a7..bddf548b67 100644 --- a/yt/yt/library/profiling/solomon/registry.h +++ b/yt/yt/library/profiling/solomon/registry.h @@ -35,62 +35,62 @@ struct TSensorInfo //////////////////////////////////////////////////////////////////////////////// class TSolomonRegistry - : public IRegistryImpl + : public IRegistry { public: explicit TSolomonRegistry(); - ICounterImplPtr RegisterCounter( + ICounterPtr RegisterCounter( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - ITimeCounterImplPtr RegisterTimeCounter( + ITimeCounterPtr RegisterTimeCounter( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - IGaugeImplPtr RegisterGauge( + IGaugePtr RegisterGauge( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - ITimeGaugeImplPtr RegisterTimeGauge( + ITimeGaugePtr RegisterTimeGauge( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - ISummaryImplPtr RegisterSummary( + ISummaryPtr RegisterSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - IGaugeImplPtr RegisterGaugeSummary( + IGaugePtr RegisterGaugeSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - ITimeGaugeImplPtr RegisterTimeGaugeSummary( + ITimeGaugePtr RegisterTimeGaugeSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - ITimerImplPtr RegisterTimerSummary( + ITimerPtr RegisterTimerSummary( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - ITimerImplPtr RegisterTimeHistogram( + ITimerPtr RegisterTimeHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - IHistogramImplPtr RegisterGaugeHistogram( + IHistogramPtr RegisterGaugeHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) override; - IHistogramImplPtr RegisterRateHistogram( + IHistogramPtr RegisterRateHistogram( const std::string& name, const TTagSet& tags, TSensorOptions options) override; diff --git a/yt/yt/library/profiling/solomon/sensor.h b/yt/yt/library/profiling/solomon/sensor.h index 391a9dbc59..0343bf7b3d 100644 --- a/yt/yt/library/profiling/solomon/sensor.h +++ b/yt/yt/library/profiling/solomon/sensor.h @@ -11,8 +11,8 @@ namespace NYT::NProfiling { //////////////////////////////////////////////////////////////////////////////// class TSimpleGauge - : public IGaugeImpl - , public ISummaryImpl + : public IGauge + , public ISummary { public: void Update(double value) override; @@ -31,8 +31,8 @@ private: //////////////////////////////////////////////////////////////////////////////// class TSimpleTimeGauge - : public ITimeGaugeImpl - , public ITimerImpl + : public ITimeGauge + , public ITimer { public: void Update(TDuration value) override; @@ -51,7 +51,7 @@ private: //////////////////////////////////////////////////////////////////////////////// class TSimpleCounter - : public ICounterImpl + : public ICounter { public: void Increment(i64 delta) override; @@ -67,7 +67,7 @@ static_assert(sizeof(TSimpleCounter) == 32); //////////////////////////////////////////////////////////////////////////////// class TSimpleTimeCounter - : public ITimeCounterImpl + : public ITimeCounter { public: void Add(TDuration delta) override; @@ -84,7 +84,7 @@ static_assert(sizeof(TSimpleTimeCounter) == 32); template <class T> class TSimpleSummary - : public ISummaryImplBase<T> + : public ISummaryBase<T> { public: void Record(T value) override; @@ -104,8 +104,8 @@ DECLARE_REFCOUNTED_CLASS(THistogram) std::vector<double> GenerateGenericBucketBounds(); class THistogram - : public ISummaryImplBase<TDuration> - , public IHistogramImpl + : public ISummaryBase<TDuration> + , public IHistogram { public: explicit THistogram(const TSensorOptions& options); diff --git a/yt/yt/library/profiling/solomon/sensor_service.cpp b/yt/yt/library/profiling/solomon/sensor_service.cpp index 4329d64264..291581f182 100644 --- a/yt/yt/library/profiling/solomon/sensor_service.cpp +++ b/yt/yt/library/profiling/solomon/sensor_service.cpp @@ -1,4 +1,6 @@ #include "sensor_service.h" + +#include "config.h" #include "cube.h" #include "exporter.h" #include "registry.h" diff --git a/yt/yt/library/profiling/solomon/sensor_set.h b/yt/yt/library/profiling/solomon/sensor_set.h index 660203ead7..c749f228d2 100644 --- a/yt/yt/library/profiling/solomon/sensor_set.h +++ b/yt/yt/library/profiling/solomon/sensor_set.h @@ -51,7 +51,7 @@ DECLARE_REFCOUNTED_STRUCT(TTimeCounterState) struct TTimeCounterState final { TTimeCounterState( - TWeakPtr<ITimeCounterImpl> owner, + TWeakPtr<ITimeCounter> owner, const TTagIdList& tagIds, const TProjectionSet& projections) : Owner(std::move(owner)) @@ -59,7 +59,7 @@ struct TTimeCounterState final , Projections(projections) { } - const TWeakPtr<ITimeCounterImpl> Owner; + const TWeakPtr<ITimeCounter> Owner; TDuration LastValue = TDuration::Zero(); TTagIdList TagIds; @@ -101,7 +101,7 @@ DECLARE_REFCOUNTED_STRUCT(TSummaryState) struct TSummaryState final { TSummaryState( - TWeakPtr<ISummaryImpl> owner, + TWeakPtr<ISummary> owner, const TTagIdList& tagIds, const TProjectionSet& projections) : Owner(std::move(owner)) @@ -109,7 +109,7 @@ struct TSummaryState final , Projections(projections) { } - const TWeakPtr<ISummaryImpl> Owner; + const TWeakPtr<ISummary> Owner; TTagIdList TagIds; const TProjectionSet Projections; @@ -124,7 +124,7 @@ DECLARE_REFCOUNTED_STRUCT(TTimerSummaryState) struct TTimerSummaryState final { TTimerSummaryState( - TWeakPtr<ITimerImpl> owner, + TWeakPtr<ITimer> owner, const TTagIdList& tagIds, const TProjectionSet& projections) : Owner(owner) @@ -132,7 +132,7 @@ struct TTimerSummaryState final , Projections(projections) { } - const TWeakPtr<ITimerImpl> Owner; + const TWeakPtr<ITimer> Owner; TTagIdList TagIds; const TProjectionSet Projections; diff --git a/yt/yt/library/profiling/solomon/ya.make b/yt/yt/library/profiling/solomon/ya.make index d578cc3e76..0eb54db10e 100644 --- a/yt/yt/library/profiling/solomon/ya.make +++ b/yt/yt/library/profiling/solomon/ya.make @@ -3,6 +3,7 @@ LIBRARY() INCLUDE(${ARCADIA_ROOT}/yt/ya_cpp.make.inc) SRCS( + config.cpp cube.cpp exporter.cpp helpers.cpp diff --git a/yt/yt/library/profiling/unittests/exporter_ut.cpp b/yt/yt/library/profiling/unittests/exporter_ut.cpp index 0b4cbbbbd8..907f290216 100644 --- a/yt/yt/library/profiling/unittests/exporter_ut.cpp +++ b/yt/yt/library/profiling/unittests/exporter_ut.cpp @@ -2,6 +2,7 @@ #include <yt/yt/core/concurrency/action_queue.h> +#include <yt/yt/library/profiling/solomon/config.h> #include <yt/yt/library/profiling/solomon/exporter.h> #include <yt/yt/library/profiling/solomon/registry.h> @@ -12,7 +13,7 @@ using namespace NConcurrency; //////////////////////////////////////////////////////////////////////////////// -TEST(TSolomonExporter, MemoryLeak) +TEST(TSolomonExporterTest, MemoryLeak) { auto registry = New<TSolomonRegistry>(); auto counter = TProfiler{registry, "yt"}.Counter("/foo"); @@ -42,7 +43,7 @@ TEST(TSolomonExporter, MemoryLeak) exporter->Stop(); } -TEST(TSolomonExporter, MemoryLeakWithSelfProfiling) +TEST(TSolomonExporterTest, MemoryLeakWithSelfProfiling) { auto registry = New<TSolomonRegistry>(); auto counter = TProfiler{registry, "yt"}.Counter("/foo"); @@ -55,7 +56,7 @@ TEST(TSolomonExporter, MemoryLeakWithSelfProfiling) auto exporter = New<TSolomonExporter>(config, registry); } -TEST(TSolomonExporter, ReadJsonHistogram) +TEST(TSolomonExporterTest, ReadJsonHistogram) { auto registry = New<TSolomonRegistry>(); auto hist = TProfiler{registry, "yt"}.TimeHistogram("/foo", TDuration::MilliSeconds(1), TDuration::Seconds(1)); @@ -83,7 +84,7 @@ TEST(TSolomonExporter, ReadJsonHistogram) exporter->Stop(); } -TEST(TSolomonExporter, ReadSpackHistogram) +TEST(TSolomonExporterTest, ReadSpackHistogram) { auto registry = New<TSolomonRegistry>(); auto hist = TProfiler{registry, "yt"}.TimeHistogram("/foo", TDuration::MilliSeconds(1), TDuration::Seconds(1)); @@ -111,7 +112,7 @@ TEST(TSolomonExporter, ReadSpackHistogram) exporter->Stop(); } -TEST(TSolomonExporter, ReadSensorsFilter) +TEST(TSolomonExporterTest, ReadSensorsFilter) { auto registry = New<TSolomonRegistry>(); @@ -178,7 +179,7 @@ TEST(TSolomonExporter, ReadSensorsFilter) exporter->Stop(); } -TEST(TSolomonExporter, ReadSensorsStripSensorsOption) +TEST(TSolomonExporterTest, ReadSensorsStripSensorsOption) { auto registry = New<TSolomonRegistry>(); diff --git a/yt/yt/library/profiling/unittests/sensor_service_ut.cpp b/yt/yt/library/profiling/unittests/sensor_service_ut.cpp index 7571a349ee..7a117a069f 100644 --- a/yt/yt/library/profiling/unittests/sensor_service_ut.cpp +++ b/yt/yt/library/profiling/unittests/sensor_service_ut.cpp @@ -4,6 +4,7 @@ #include <yt/yt/core/ytree/ypath_client.h> #include <yt/yt/core/ytree/ypath_proxy.h> +#include <yt/yt/library/profiling/solomon/config.h> #include <yt/yt/library/profiling/solomon/registry.h> #include <yt/yt/library/profiling/solomon/exporter.h> #include <yt/yt/library/profiling/solomon/sensor_service.h> diff --git a/yt/yt/library/program/config.cpp b/yt/yt/library/program/config.cpp index 075ff8f7ed..c27f4a8ca3 100644 --- a/yt/yt/library/program/config.cpp +++ b/yt/yt/library/program/config.cpp @@ -1,5 +1,7 @@ #include "config.h" +#include <yt/yt/library/profiling/solomon/config.h> + #include <yt/yt/core/concurrency/fiber_scheduler_thread.h> namespace NYT { |