11#pragma once
22#include " engines/changes/abstract/compaction_info.h"
33#include " engines/portions/meta.h"
4+ #include < ydb/core/tx/columnshard/counters/counters_manager.h>
45
56namespace NKikimr ::NOlap {
67class TColumnEngineChanges ;
@@ -15,11 +16,16 @@ class TBackgroundController {
1516 using TCurrentCompaction = THashMap<ui64, NOlap::TPlanCompactionInfo>;
1617 TCurrentCompaction ActiveCompactionInfo;
1718
19+ std::shared_ptr<TBackgroundControllerCounters> Counters;
1820 bool ActiveCleanupPortions = false ;
1921 bool ActiveCleanupTables = false ;
2022 bool ActiveCleanupInsertTable = false ;
2123 YDB_READONLY (TMonotonic, LastIndexationInstant, TMonotonic::Zero());
2224public:
25+ TBackgroundController (std::shared_ptr<TBackgroundControllerCounters> counters)
26+ : Counters(std::move(counters)) {
27+ }
28+
2329 THashSet<NOlap::TPortionAddress> GetConflictTTLPortions () const ;
2430 THashSet<NOlap::TPortionAddress> GetConflictCompactionPortions () const ;
2531
@@ -29,6 +35,7 @@ class TBackgroundController {
2935 bool StartCompaction (const NOlap::TPlanCompactionInfo& info);
3036 void FinishCompaction (const NOlap::TPlanCompactionInfo& info) {
3137 Y_ABORT_UNLESS (ActiveCompactionInfo.erase (info.GetPathId ()));
38+ Counters->OnCompactionFinish (info.GetPathId ());
3239 }
3340 const TCurrentCompaction& GetActiveCompaction () const {
3441 return ActiveCompactionInfo;
0 commit comments