From b9874d1d3fe026bc85e5ef94126e59e19aabc77e Mon Sep 17 00:00:00 2001 From: vporyadke <48287411+vporyadke@users.noreply.github.com> Date: Fri, 15 Dec 2023 16:16:31 +0300 Subject: skip empty metrics KIKIMR-20270 skip empty metrics KIKIMR-20270 Pull Request resolved: https://github.com/ydb-platform/ydb/pull/509 --- ydb/core/mind/hive/tablet_info.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ydb/core/mind/hive/tablet_info.cpp b/ydb/core/mind/hive/tablet_info.cpp index 15a7c809689..bb998dfe473 100644 --- a/ydb/core/mind/hive/tablet_info.cpp +++ b/ydb/core/mind/hive/tablet_info.cpp @@ -319,7 +319,7 @@ void TTabletInfo::UpdateResourceUsage(const NKikimrTabletBase::TMetrics& metrics auto before = ResourceValues; auto maximum = GetResourceMaximumValues(); if (Find(allowedMetricIds, NKikimrTabletBase::TMetrics::kCPUFieldNumber) != allowedMetricIds.end()) { - if (metrics.HasCPU() || ResourceValues.HasCPU()) { + if (metrics.HasCPU()) { if (metrics.GetCPU() > static_cast(std::get(maximum))) { BLOG_W("Ignoring too high CPU metric (" << metrics.GetCPU() << ") for tablet " << ToString()); } else { @@ -329,7 +329,7 @@ void TTabletInfo::UpdateResourceUsage(const NKikimrTabletBase::TMetrics& metrics } } if (Find(allowedMetricIds, NKikimrTabletBase::TMetrics::kMemoryFieldNumber) != allowedMetricIds.end()) { - if (metrics.HasMemory() || ResourceValues.HasMemory()) { + if (metrics.HasMemory()) { if (metrics.GetMemory() > static_cast(std::get(maximum))) { BLOG_W("Ignoring too high Memory metric (" << metrics.GetMemory() << ") for tablet " << ToString()); } else { @@ -339,7 +339,7 @@ void TTabletInfo::UpdateResourceUsage(const NKikimrTabletBase::TMetrics& metrics } } if (Find(allowedMetricIds, NKikimrTabletBase::TMetrics::kNetworkFieldNumber) != allowedMetricIds.end()) { - if (metrics.HasNetwork() || ResourceValues.HasNetwork()) { + if (metrics.HasNetwork()) { if (metrics.GetNetwork() > static_cast(std::get(maximum))) { BLOG_W("Ignoring too high Network metric (" << metrics.GetNetwork() << ") for tablet " << ToString()); } else { -- cgit v1.3