#pragma once #include "sensors_group.h" #include namespace NYql { namespace NProto { class TMetricsRegistrySnapshot; } struct IMetricsRegistry; using IMetricsRegistryPtr = TIntrusivePtr; using TMetricsDecorator = std::function; ////////////////////////////////////////////////////////////////////////////// // IYqlMetricsRegistry ////////////////////////////////////////////////////////////////////////////// struct IMetricsRegistry: public TThrRefBase { virtual void SetCounter( const TString& labelName, const TString& labelValue, i64 value, bool derivative = false) = 0; virtual void IncCounter( const TString& labelName, const TString& labelValue, bool derivative = true) = 0; virtual void AddCounter( const TString& labelName, const TString& labelValue, i64 value, bool derivative = true) = 0; // will invalidate all counters virtual bool TakeSnapshot( NProto::TMetricsRegistrySnapshot* snapshot) const = 0; virtual void MergeSnapshot( const NProto::TMetricsRegistrySnapshot& snapshot) = 0; virtual IMetricsRegistryPtr Personalized( const TString& userName) const = 0; virtual void Flush() = 0; virtual TSensorsGroupPtr GetSensors() { ythrow yexception() << "Not implemented"; } }; IMetricsRegistryPtr CreateMetricsRegistry(TSensorsGroupPtr sensors); } // namespace NYql