summaryrefslogtreecommitdiffstats
path: root/yt/cpp/mapreduce/common/debug_metrics.cpp
diff options
context:
space:
mode:
authormax42 <[email protected]>2023-06-30 11:13:34 +0300
committermax42 <[email protected]>2023-06-30 11:13:34 +0300
commit3e1899838408bbad47622007aa382bc8a2b01f87 (patch)
tree0f21c1e6add187ddb6c3ccc048a7d640ce03fb87 /yt/cpp/mapreduce/common/debug_metrics.cpp
parent5463eb3f5e72a86f858a3d27c886470a724ede34 (diff)
Revert "YT-19324: move YT provider to ydb/library/yql"
This reverts commit ca272f12fdd0e8d5c3e957fc87939148f1caaf72, reversing changes made to 49f8acfc8b0b5c0071b804423bcf53fda26c7c12.
Diffstat (limited to 'yt/cpp/mapreduce/common/debug_metrics.cpp')
-rw-r--r--yt/cpp/mapreduce/common/debug_metrics.cpp62
1 files changed, 0 insertions, 62 deletions
diff --git a/yt/cpp/mapreduce/common/debug_metrics.cpp b/yt/cpp/mapreduce/common/debug_metrics.cpp
deleted file mode 100644
index 6235e55f7e6..00000000000
--- a/yt/cpp/mapreduce/common/debug_metrics.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-#include "debug_metrics.h"
-
-#include <util/generic/hash.h>
-#include <util/generic/singleton.h>
-
-#include <util/string/cast.h>
-#include <util/system/mutex.h>
-
-namespace NYT {
-namespace NDetail {
-
-////////////////////////////////////////////////////////////////////////////////
-
-class TDebugMetrics {
-public:
- static TDebugMetrics& Get()
- {
- return *Singleton<TDebugMetrics>();
- }
-
- void Inc(TStringBuf name)
- {
- auto g = Guard(Lock_);
- auto it = Metrics_.find(name);
- if (it == Metrics_.end()) {
- it = Metrics_.emplace(ToString(name), 0).first;
- }
- ++it->second;
- }
-
- ui64 Get(TStringBuf name) const
- {
- auto g = Guard(Lock_);
- auto it = Metrics_.find(name);
- if (it == Metrics_.end()) {
- return 0;
- } else {
- return it->second;
- }
- }
-
-private:
- TMutex Lock_;
- THashMap<TString, ui64> Metrics_;
-};
-
-////////////////////////////////////////////////////////////////////////////////
-
-void IncDebugMetricImpl(TStringBuf name)
-{
- TDebugMetrics::Get().Inc(name);
-}
-
-ui64 GetDebugMetric(TStringBuf name)
-{
- return TDebugMetrics::Get().Get(name);
-}
-
-////////////////////////////////////////////////////////////////////////////////
-
-} // namespace NDetail
-} // namespace NYT