Skip to content

Commit 51438c1

Browse files
authored
Merge e5761bf into bba21cb
2 parents bba21cb + e5761bf commit 51438c1

File tree

4 files changed

+47
-0
lines changed

4 files changed

+47
-0
lines changed

ydb/core/blobstorage/vdisk/common/vdisk_mongroups.h

+35
Original file line numberDiff line numberDiff line change
@@ -899,5 +899,40 @@ public:
899899
COUNTER_DEF(SkeletonFrontUptimeSeconds);
900900
};
901901

902+
///////////////////////////////////////////////////////////////////////////////////
903+
// TCompactionStrategyGroup
904+
///////////////////////////////////////////////////////////////////////////////////
905+
class TCompactionStrategyGroup : public TBase {
906+
public:
907+
GROUP_CONSTRUCTOR(TCompactionStrategyGroup)
908+
{
909+
COUNTER_INIT(BlobsDelSst, true);
910+
COUNTER_INIT(BlobsPromoteSsts, true);
911+
COUNTER_INIT(BlobsExplicit, true);
912+
COUNTER_INIT(BlobsBalance, true);
913+
COUNTER_INIT(BlobsFreeSpace, true);
914+
COUNTER_INIT(BlobsSqueeze, true);
915+
916+
COUNTER_INIT(BlocksPromoteSsts, true);
917+
COUNTER_INIT(BlocksBalance, true);
918+
919+
COUNTER_INIT(BarriersPromoteSsts, true);
920+
COUNTER_INIT(BarriersBalance, true);
921+
}
922+
923+
COUNTER_DEF(BlobsDelSst);
924+
COUNTER_DEF(BlobsPromoteSsts);
925+
COUNTER_DEF(BlobsExplicit);
926+
COUNTER_DEF(BlobsBalance);
927+
COUNTER_DEF(BlobsFreeSpace);
928+
COUNTER_DEF(BlobsSqueeze);
929+
930+
COUNTER_DEF(BlocksPromoteSsts);
931+
COUNTER_DEF(BlocksBalance);
932+
933+
COUNTER_DEF(BarriersPromoteSsts);
934+
COUNTER_DEF(BarriersBalance);
935+
};
936+
902937
} // NMonGroup
903938
} // NKikimr

ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ namespace NKikimr {
110110
, HullCompStorageRatioCalcPeriod(hullCompStorageRatioCalcPeriod)
111111
, HullCompStorageRatioMaxCalcDuration(hullCompStorageRatioMaxCalcDuration)
112112
, AddHeader(addHeader)
113+
, CompactionStrategyGroup(VCtx->VDiskCounters, "subsystem", "compstrategy")
113114
, LsmHullGroup(VCtx->VDiskCounters, "subsystem", "lsmhull")
114115
, LsmHullSpaceGroup(VCtx->VDiskCounters, "subsystem", "outofspace")
115116
{}

ydb/core/blobstorage/vdisk/hulldb/base/blobstorage_hulldefs.h

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ namespace NKikimr {
140140
const TDuration HullCompStorageRatioMaxCalcDuration;
141141
const bool AddHeader;
142142

143+
NMonGroup::TCompactionStrategyGroup CompactionStrategyGroup;
143144
NMonGroup::TLsmHullGroup LsmHullGroup;
144145
NMonGroup::TLsmHullSpaceGroup LsmHullSpaceGroup;
145146

ydb/core/blobstorage/vdisk/hulldb/compstrat/hulldb_compstrat_selector.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -36,37 +36,43 @@ namespace NKikimr {
3636
// delete free ssts
3737
action = TStrategyDelSst(HullCtx, LevelSnap, Task).Select();
3838
if (action != ActNothing) {
39+
++HullCtx->CompactionStrategyGroup.BlobsDelSst();
3940
return action;
4041
}
4142

4243
// try to promote ssts on higher levels w/o merging
4344
action = TStrategyPromoteSsts(HullCtx, Params.Boundaries, LevelSnap, Task).Select();
4445
if (action != ActNothing) {
46+
++HullCtx->CompactionStrategyGroup.BlobsPromoteSsts();
4547
return action;
4648
}
4749

4850
// compact explicitly defined SST's, if set
4951
action = TStrategyExplicit(HullCtx, Params, LevelSnap, Task).Select();
5052
if (action != ActNothing) {
53+
++HullCtx->CompactionStrategyGroup.BlobsExplicit();
5154
return action;
5255
}
5356

5457
// try to find what to compact based on levels balance
5558
action = TStrategyBalance(HullCtx, Params, LevelSnap, Task).Select();
5659
if (action != ActNothing) {
60+
++HullCtx->CompactionStrategyGroup.BlobsBalance();
5761
return action;
5862
}
5963

6064
// try to find what to compact base on storage consumption
6165
action = TStrategyFreeSpace(HullCtx, LevelSnap, Task).Select();
6266
if (action != ActNothing) {
67+
++HullCtx->CompactionStrategyGroup.BlobsFreeSpace();
6368
return action;
6469
}
6570

6671
// try to squeeze if required
6772
if (Params.SqueezeBefore) {
6873
action = TStrategySqueeze(HullCtx, LevelSnap, Task, Params.SqueezeBefore).Select();
6974
if (action != ActNothing) {
75+
++HullCtx->CompactionStrategyGroup.BlobsSqueeze();
7076
return action;
7177
}
7278
}
@@ -89,12 +95,14 @@ namespace NKikimr {
8995
// try to promote ssts on higher levels w/o merging
9096
action = TStrategyPromoteSsts(HullCtx, Params.Boundaries, LevelSnap, Task).Select();
9197
if (action != ActNothing) {
98+
++HullCtx->CompactionStrategyGroup.BlocksPromoteSsts();
9299
return action;
93100
}
94101

95102
// try to find what to compact based on levels balance
96103
action = TStrategyBalance(HullCtx, Params, LevelSnap, Task).Select();
97104
if (action != ActNothing) {
105+
++HullCtx->CompactionStrategyGroup.BlocksBalance();
98106
return action;
99107
}
100108

@@ -117,12 +125,14 @@ namespace NKikimr {
117125
// try to promote ssts on higher levels w/o merging
118126
action = TStrategyPromoteSsts(HullCtx, Params.Boundaries, LevelSnap, Task).Select();
119127
if (action != ActNothing) {
128+
++HullCtx->CompactionStrategyGroup.BarriersPromoteSsts();
120129
return action;
121130
}
122131

123132
// try to find what to compact based on levels balance
124133
action = TStrategyBalance(HullCtx, Params, LevelSnap, Task).Select();
125134
if (action != ActNothing) {
135+
++HullCtx->CompactionStrategyGroup.BarriersBalance();
126136
return action;
127137
}
128138

0 commit comments

Comments
 (0)