diff --git a/ydb/core/blobstorage/vdisk/common/vdisk_mongroups.h b/ydb/core/blobstorage/vdisk/common/vdisk_mongroups.h index 604cb71482a8..b443c38e151e 100644 --- a/ydb/core/blobstorage/vdisk/common/vdisk_mongroups.h +++ b/ydb/core/blobstorage/vdisk/common/vdisk_mongroups.h @@ -899,5 +899,40 @@ public: COUNTER_DEF(SkeletonFrontUptimeSeconds); }; + /////////////////////////////////////////////////////////////////////////////////// + // TCompactionStrategyGroup + /////////////////////////////////////////////////////////////////////////////////// + class TCompactionStrategyGroup : public TBase { + public: + GROUP_CONSTRUCTOR(TCompactionStrategyGroup) + { + COUNTER_INIT(BlobsDelSst, true); + COUNTER_INIT(BlobsPromoteSsts, true); + COUNTER_INIT(BlobsExplicit, true); + COUNTER_INIT(BlobsBalance, true); + COUNTER_INIT(BlobsFreeSpace, true); + COUNTER_INIT(BlobsSqueeze, true); + + COUNTER_INIT(BlocksPromoteSsts, true); + COUNTER_INIT(BlocksBalance, true); + + COUNTER_INIT(BarriersPromoteSsts, true); + COUNTER_INIT(BarriersBalance, true); + } + + COUNTER_DEF(BlobsDelSst); + COUNTER_DEF(BlobsPromoteSsts); + COUNTER_DEF(BlobsExplicit); + COUNTER_DEF(BlobsBalance); + COUNTER_DEF(BlobsFreeSpace); + COUNTER_DEF(BlobsSqueeze); + + COUNTER_DEF(BlocksPromoteSsts); + COUNTER_DEF(BlocksBalance); + + COUNTER_DEF(BarriersPromoteSsts); + COUNTER_DEF(BarriersBalance); + }; + } // NMonGroup } // NKikimr diff --git a/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.cpp b/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.cpp index f73a386a865d..c4ec49e17e37 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.cpp +++ b/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.cpp @@ -110,6 +110,7 @@ namespace NKikimr { , HullCompStorageRatioCalcPeriod(hullCompStorageRatioCalcPeriod) , HullCompStorageRatioMaxCalcDuration(hullCompStorageRatioMaxCalcDuration) , AddHeader(addHeader) + , CompactionStrategyGroup(VCtx->VDiskCounters, "subsystem", "compstrategy") , LsmHullGroup(VCtx->VDiskCounters, "subsystem", "lsmhull") , LsmHullSpaceGroup(VCtx->VDiskCounters, "subsystem", "outofspace") {} diff --git a/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.h b/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.h index d21c5096e3ad..5ec3dfbd1789 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.h +++ b/ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.h @@ -140,6 +140,7 @@ namespace NKikimr { const TDuration HullCompStorageRatioMaxCalcDuration; const bool AddHeader; + NMonGroup::TCompactionStrategyGroup CompactionStrategyGroup; NMonGroup::TLsmHullGroup LsmHullGroup; NMonGroup::TLsmHullSpaceGroup LsmHullSpaceGroup; diff --git a/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_selector.cpp b/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_selector.cpp index af4b0ac4b71d..484187736463 100644 --- a/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_selector.cpp +++ b/ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_selector.cpp @@ -36,30 +36,35 @@ namespace NKikimr { // delete free ssts action = TStrategyDelSst(HullCtx, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlobsDelSst(); return action; } // try to promote ssts on higher levels w/o merging action = TStrategyPromoteSsts(HullCtx, Params.Boundaries, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlobsPromoteSsts(); return action; } // compact explicitly defined SST's, if set action = TStrategyExplicit(HullCtx, Params, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlobsExplicit(); return action; } // try to find what to compact based on levels balance action = TStrategyBalance(HullCtx, Params, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlobsBalance(); return action; } // try to find what to compact base on storage consumption action = TStrategyFreeSpace(HullCtx, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlobsFreeSpace(); return action; } @@ -67,6 +72,7 @@ namespace NKikimr { if (Params.SqueezeBefore) { action = TStrategySqueeze(HullCtx, LevelSnap, Task, Params.SqueezeBefore).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlobsSqueeze(); return action; } } @@ -89,12 +95,14 @@ namespace NKikimr { // try to promote ssts on higher levels w/o merging action = TStrategyPromoteSsts(HullCtx, Params.Boundaries, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlocksPromoteSsts(); return action; } // try to find what to compact based on levels balance action = TStrategyBalance(HullCtx, Params, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BlocksBalance(); return action; } @@ -117,12 +125,14 @@ namespace NKikimr { // try to promote ssts on higher levels w/o merging action = TStrategyPromoteSsts(HullCtx, Params.Boundaries, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BarriersPromoteSsts(); return action; } // try to find what to compact based on levels balance action = TStrategyBalance(HullCtx, Params, LevelSnap, Task).Select(); if (action != ActNothing) { + ++HullCtx->CompactionStrategyGroup.BarriersBalance(); return action; }