diff options
author | dave11ar <dave11ar@yandex-team.com> | 2023-10-17 14:55:07 +0300 |
---|---|---|
committer | dave11ar <dave11ar@yandex-team.com> | 2023-10-17 15:34:44 +0300 |
commit | 674acb9e3f858c628f128c2e7796a4bca668b7c4 (patch) | |
tree | 8f1cb74fd8397f61d9708c771b609894ebec415e | |
parent | bb268f4050420167111455bf6682288627ffbff6 (diff) | |
download | ydb-674acb9e3f858c628f128c2e7796a4bca668b7c4.tar.gz |
YT-20007: Small profiling lib refactoring
-rw-r--r-- | yt/yt/library/profiling/sensor.cpp | 8 | ||||
-rw-r--r-- | yt/yt/library/profiling/solomon/exporter.cpp | 4 | ||||
-rw-r--r-- | yt/yt/library/profiling/solomon/sensor_dump.proto | 35 |
3 files changed, 27 insertions, 20 deletions
diff --git a/yt/yt/library/profiling/sensor.cpp b/yt/yt/library/profiling/sensor.cpp index 8b8ed3d712..560d9760bf 100644 --- a/yt/yt/library/profiling/sensor.cpp +++ b/yt/yt/library/profiling/sensor.cpp @@ -16,10 +16,10 @@ namespace NYT::NProfiling { TSummaryPolicyConflicts GetSummaryPolicyConflicts(ESummaryPolicy policy) { bool isAllPolicy = Any(policy & ESummaryPolicy::All); - int specifiedAggregateCount = Any(policy & ESummaryPolicy::Sum) + - Any(policy & ESummaryPolicy::Min) + - Any(policy & ESummaryPolicy::Max) + - Any(policy & ESummaryPolicy::Avg); + int specifiedAggregateCount = static_cast<int>(Any(policy & ESummaryPolicy::Sum)) + + static_cast<int>(Any(policy & ESummaryPolicy::Min)) + + static_cast<int>(Any(policy & ESummaryPolicy::Max)) + + static_cast<int>(Any(policy & ESummaryPolicy::Avg)); return { .AllPolicyWithSpecifiedAggregates = isAllPolicy && specifiedAggregateCount > 0, diff --git a/yt/yt/library/profiling/solomon/exporter.cpp b/yt/yt/library/profiling/solomon/exporter.cpp index 4e6ec19b2d..8fca744ebb 100644 --- a/yt/yt/library/profiling/solomon/exporter.cpp +++ b/yt/yt/library/profiling/solomon/exporter.cpp @@ -995,12 +995,12 @@ void TSolomonExporter::ValidateSummaryPolicy(ESummaryPolicy policy) auto summaryPolicyConflicts = GetSummaryPolicyConflicts(policy); if (summaryPolicyConflicts.AllPolicyWithSpecifiedAggregates) { THROW_ERROR SummaryPolicyError - << TError("%Qv policy can be used only without specified policies", ESummaryPolicy::All) + << TError("%Qlv policy can be used only without specified policies", ESummaryPolicy::All) << TErrorAttribute("policy", policy); } if (summaryPolicyConflicts.OmitNameLabelSuffixWithSeveralAggregates) { THROW_ERROR SummaryPolicyError - << TError("%Qv option can be used only with single specified policy", ESummaryPolicy::OmitNameLabelSuffix) + << TError("%Qlv option can be used only with single specified policy", ESummaryPolicy::OmitNameLabelSuffix) << TErrorAttribute("policy", policy); } } diff --git a/yt/yt/library/profiling/solomon/sensor_dump.proto b/yt/yt/library/profiling/solomon/sensor_dump.proto index 7180e0af39..8c98a09835 100644 --- a/yt/yt/library/profiling/solomon/sensor_dump.proto +++ b/yt/yt/library/profiling/solomon/sensor_dump.proto @@ -1,16 +1,19 @@ package NYT.NProfiling.NProto; -message TSensorDump { +message TSensorDump +{ repeated TTag tags = 2; repeated TCube cubes = 1; -}; +} -message TTag { +message TTag +{ required string key = 1; required string value = 2; -}; +} -message TCube { +message TCube +{ required string name = 1; repeated TProjection projections = 2; @@ -20,9 +23,10 @@ message TCube { optional bool disable_default = 6 [default=false]; optional uint64 summary_policy = 7; // ESummaryPolicy -}; +} -message TProjection { +message TProjection +{ repeated int64 tag_ids = 1; required bool has_value = 8; @@ -35,25 +39,28 @@ message TProjection { optional THistogramSnapshot time_histogram = 7; optional THistogramSnapshot gauge_histogram = 9; optional THistogramSnapshot rate_histogram = 10; -}; +} -message TSummaryDouble { +message TSummaryDouble +{ required double sum = 1; required double min = 2; required double max = 3; required double last = 4; required int64 count = 5; -}; +} -message TSummaryDuration { +message TSummaryDuration +{ required int64 sum = 1; required int64 min = 2; required int64 max = 3; required int64 last = 4; required int64 count = 5; -}; +} -message THistogramSnapshot { +message THistogramSnapshot +{ repeated int64 values = 1; repeated int64 times = 2; -}; +} |