aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/lwtrace/mon/analytics/data.h
diff options
context:
space:
mode:
authorlianabatalova <lianabatalova@yandex-team.ru>2022-02-10 16:49:11 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:49:11 +0300
commit5bb473368cbb2d67a30433d2cd55e8e32460dea8 (patch)
tree05d166cc67f02e379edbe07942017ed65bcf0cf6 /library/cpp/lwtrace/mon/analytics/data.h
parent6c7ed19fb4e807d81f39d5b370b1dba604558a17 (diff)
downloadydb-5bb473368cbb2d67a30433d2cd55e8e32460dea8.tar.gz
Restoring authorship annotation for <lianabatalova@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/lwtrace/mon/analytics/data.h')
-rw-r--r--library/cpp/lwtrace/mon/analytics/data.h82
1 files changed, 41 insertions, 41 deletions
diff --git a/library/cpp/lwtrace/mon/analytics/data.h b/library/cpp/lwtrace/mon/analytics/data.h
index 4b643fe20b..2998f0adca 100644
--- a/library/cpp/lwtrace/mon/analytics/data.h
+++ b/library/cpp/lwtrace/mon/analytics/data.h
@@ -3,57 +3,57 @@
#include <util/generic/string.h>
#include <util/generic/hash.h>
#include <util/generic/vector.h>
-#include <util/string/builder.h>
-#include <util/string/cast.h>
-
-#include <variant>
+#include <util/string/builder.h>
+#include <util/string/cast.h>
+#include <variant>
+
namespace NAnalytics {
-using TRowValue = std::variant<i64, ui64, double, TString>;
-
-TString ToString(const TRowValue& val) {
- TStringBuilder builder;
- std::visit([&builder] (auto&& arg) {
- builder << arg;
- }, val);
- return builder;
-}
-
-struct TRow : public THashMap<TString, TRowValue> {
+using TRowValue = std::variant<i64, ui64, double, TString>;
+
+TString ToString(const TRowValue& val) {
+ TStringBuilder builder;
+ std::visit([&builder] (auto&& arg) {
+ builder << arg;
+ }, val);
+ return builder;
+}
+
+struct TRow : public THashMap<TString, TRowValue> {
TString Name;
- template<typename T>
- bool Get(const TString& name, T& value) const {
- if constexpr (std::is_same_v<double, T>) {
- if (name == "_count") { // Special values
- value = 1.0;
- return true;
- }
+ template<typename T>
+ bool Get(const TString& name, T& value) const {
+ if constexpr (std::is_same_v<double, T>) {
+ if (name == "_count") { // Special values
+ value = 1.0;
+ return true;
+ }
}
auto iter = find(name);
if (iter != end()) {
- try {
- value = std::get<T>(iter->second);
- return true;
- } catch (...) {}
- }
- return false;
- }
-
- template<typename T = double>
- T GetOrDefault(const TString& name, T dflt = T()) {
- Get(name, dflt);
- return dflt;
- }
-
- bool GetAsString(const TString& name, TString& value) const {
- auto iter = find(name);
- if (iter != end()) {
- value = ToString(iter->second);
+ try {
+ value = std::get<T>(iter->second);
+ return true;
+ } catch (...) {}
+ }
+ return false;
+ }
+
+ template<typename T = double>
+ T GetOrDefault(const TString& name, T dflt = T()) {
+ Get(name, dflt);
+ return dflt;
+ }
+
+ bool GetAsString(const TString& name, TString& value) const {
+ auto iter = find(name);
+ if (iter != end()) {
+ value = ToString(iter->second);
return true;
}
- return false;
+ return false;
}
};