diff options
author | ivanmorozov333 <ivanmorozov@ydb.tech> | 2024-06-03 12:04:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-03 12:04:36 +0300 |
commit | ca8e9f111e802a293622edd956d6f7c841f42d8e (patch) | |
tree | 2e710776ff865b2160f807f77535c88a0388d854 | |
parent | c08ddba1026a616a0e48c8959e5a7fb3408e27ae (diff) | |
download | ydb-ca8e9f111e802a293622edd956d6f7c841f42d8e.tar.gz |
fix signals about blob size distribution (#5107)
-rw-r--r-- | ydb/core/tx/columnshard/counters/engine_logs.cpp | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/ydb/core/tx/columnshard/counters/engine_logs.cpp b/ydb/core/tx/columnshard/counters/engine_logs.cpp index e9daf966e1..368eebc40e 100644 --- a/ydb/core/tx/columnshard/counters/engine_logs.cpp +++ b/ydb/core/tx/columnshard/counters/engine_logs.cpp @@ -83,11 +83,18 @@ void TEngineLogsCounters::OnActualizationTask(const ui32 evictCount, const ui32 void TEngineLogsCounters::TPortionsInfoGuard::OnNewPortion(const std::shared_ptr<NOlap::TPortionInfo>& portion) const { const ui32 producedId = (ui32)(portion->HasRemoveSnapshot() ? NOlap::NPortion::EProduced::INACTIVE : portion->GetMeta().Produced); Y_ABORT_UNLESS(producedId < BlobGuards.size()); + THashSet<NOlap::TUnifiedBlobId> blobIds; for (auto&& i : portion->GetRecords()) { - BlobGuards[producedId]->Add(i.GetBlobRange().Size, i.GetBlobRange().Size); + const auto blobId = portion->GetBlobId(i.GetBlobRange().GetBlobIdxVerified()); + if (blobIds.emplace(blobId).second) { + BlobGuards[producedId]->Add(blobId.BlobSize(), blobId.BlobSize()); + } } for (auto&& i : portion->GetIndexes()) { - BlobGuards[producedId]->Add(i.GetBlobRange().Size, i.GetBlobRange().Size); + const auto blobId = portion->GetBlobId(i.GetBlobRange().GetBlobIdxVerified()); + if (blobIds.emplace(blobId).second) { + BlobGuards[producedId]->Add(blobId.BlobSize(), blobId.BlobSize()); + } } PortionRecordCountGuards[producedId]->Add(portion->GetRecordsCount(), 1); PortionSizeGuards[producedId]->Add(portion->GetTotalBlobBytes(), 1); @@ -96,11 +103,18 @@ void TEngineLogsCounters::TPortionsInfoGuard::OnNewPortion(const std::shared_ptr void TEngineLogsCounters::TPortionsInfoGuard::OnDropPortion(const std::shared_ptr<NOlap::TPortionInfo>& portion) const { const ui32 producedId = (ui32)(portion->HasRemoveSnapshot() ? NOlap::NPortion::EProduced::INACTIVE : portion->GetMeta().Produced); Y_ABORT_UNLESS(producedId < BlobGuards.size()); + THashSet<NOlap::TUnifiedBlobId> blobIds; for (auto&& i : portion->GetRecords()) { - BlobGuards[producedId]->Sub(i.GetBlobRange().Size, i.GetBlobRange().Size); + const auto blobId = portion->GetBlobId(i.GetBlobRange().GetBlobIdxVerified()); + if (blobIds.emplace(blobId).second) { + BlobGuards[producedId]->Sub(blobId.BlobSize(), blobId.BlobSize()); + } } for (auto&& i : portion->GetIndexes()) { - BlobGuards[producedId]->Sub(i.GetBlobRange().Size, i.GetBlobRange().Size); + const auto blobId = portion->GetBlobId(i.GetBlobRange().GetBlobIdxVerified()); + if (blobIds.emplace(blobId).second) { + BlobGuards[producedId]->Sub(blobId.BlobSize(), blobId.BlobSize()); + } } PortionRecordCountGuards[producedId]->Sub(portion->GetRecordsCount(), 1); PortionSizeGuards[producedId]->Sub(portion->GetTotalBlobBytes(), 1); |