Skip to content

Commit f069a43

Browse files
committed
post-review fixes
1 parent 7a579d0 commit f069a43

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

ydb/core/tx/columnshard/columnshard__write.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,27 +16,21 @@ void TColumnShard::OverloadWriteFail(const EOverloadStatus overloadReason, const
1616
Counters.GetTabletCounters()->IncCounter(COUNTER_WRITE_FAIL);
1717
switch (overloadReason) {
1818
case EOverloadStatus::Disk:
19-
Counters.GetTabletCounters()->IncCounter(COUNTER_OUT_OF_SPACE);
19+
Counters.GetCSCounters().OnWriteOverloadDisk(writeData.GetSize());
2020
break;
2121
case EOverloadStatus::InsertTable:
22-
// TODO: Move all IncCounter's below under OnWriteOverload*
23-
Counters.GetTabletCounters()->IncCounter(COUNTER_WRITE_OVERLOAD);
2422
Counters.GetCSCounters().OnWriteOverloadInsertTable(writeData.GetSize());
2523
break;
2624
case EOverloadStatus::OverloadMetadata:
27-
Counters.GetTabletCounters()->IncCounter(COUNTER_WRITE_OVERLOAD);
2825
Counters.GetCSCounters().OnWriteOverloadMetadata(writeData.GetSize());
2926
break;
3027
case EOverloadStatus::ShardTxInFly:
31-
Counters.GetTabletCounters()->IncCounter(COUNTER_WRITE_OVERLOAD);
3228
Counters.GetCSCounters().OnWriteOverloadShardTx(writeData.GetSize());
3329
break;
3430
case EOverloadStatus::ShardWritesInFly:
35-
Counters.GetTabletCounters()->IncCounter(COUNTER_WRITE_OVERLOAD);
3631
Counters.GetCSCounters().OnWriteOverloadShardWrites(writeData.GetSize());
3732
break;
3833
case EOverloadStatus::ShardWritesSizeInFly:
39-
Counters.GetTabletCounters()->IncCounter(COUNTER_WRITE_OVERLOAD);
4034
Counters.GetCSCounters().OnWriteOverloadShardWritesSize(writeData.GetSize());
4135
break;
4236
case EOverloadStatus::None:

ydb/core/tx/columnshard/counters/columnshard.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <library/cpp/monlib/dynamic_counters/counters.h>
55

66
#include <util/generic/hash_set.h>
7+
#include <ydb/core/tx/columnshard/counters/tablet_counters.h>
78

89
namespace NKikimr::NColumnShard {
910

@@ -20,6 +21,8 @@ class TCSCounters: public TCommonCountersOwner {
2021
private:
2122
using TBase = TCommonCountersOwner;
2223

24+
std::shared_ptr<TTabletCountersHandle> TabletCounters;
25+
2326
NMonitoring::TDynamicCounters::TCounterPtr StartBackgroundCount;
2427
NMonitoring::TDynamicCounters::TCounterPtr TooEarlyBackgroundCount;
2528
NMonitoring::TDynamicCounters::TCounterPtr SetupCompactionCount;
@@ -130,27 +133,36 @@ class TCSCounters: public TCommonCountersOwner {
130133
SplitCompactionGranulePortionsCount->SetValue(portionsCount);
131134
}
132135

136+
void OnWriteOverloadDisk(const ui64 /*size*/) const {
137+
TabletCounters->IncCounter(COUNTER_OUT_OF_SPACE);
138+
}
139+
133140
void OnWriteOverloadInsertTable(const ui64 size) const {
141+
TabletCounters->IncCounter(COUNTER_WRITE_OVERLOAD);
134142
OverloadInsertTableBytes->Add(size);
135143
OverloadInsertTableCount->Add(1);
136144
}
137145

138146
void OnWriteOverloadMetadata(const ui64 size) const {
147+
TabletCounters->IncCounter(COUNTER_WRITE_OVERLOAD);
139148
OverloadMetadataBytes->Add(size);
140149
OverloadMetadataCount->Add(1);
141150
}
142151

143152
void OnWriteOverloadShardTx(const ui64 size) const {
153+
TabletCounters->IncCounter(COUNTER_WRITE_OVERLOAD);
144154
OverloadShardTxBytes->Add(size);
145155
OverloadShardTxCount->Add(1);
146156
}
147157

148158
void OnWriteOverloadShardWrites(const ui64 size) const {
159+
TabletCounters->IncCounter(COUNTER_WRITE_OVERLOAD);
149160
OverloadShardWritesBytes->Add(size);
150161
OverloadShardWritesCount->Add(1);
151162
}
152163

153164
void OnWriteOverloadShardWritesSize(const ui64 size) const {
165+
TabletCounters->IncCounter(COUNTER_WRITE_OVERLOAD);
154166
OverloadShardWritesSizeBytes->Add(size);
155167
OverloadShardWritesSizeCount->Add(1);
156168
}

0 commit comments

Comments
 (0)