Skip to content

Commit bff272f

Browse files
authored
Added debug logging for table stats (#10065)
1 parent 9c46173 commit bff272f

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

ydb/core/tx/columnshard/engines/column_engine_logs.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@ const TColumnEngineStats& TColumnEngineForLogs::GetTotalStats() {
6060

6161
void TColumnEngineForLogs::UpdatePortionStats(const TPortionInfo& portionInfo, EStatsUpdateType updateType,
6262
const TPortionInfo* exPortionInfo) {
63-
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
64-
63+
if (IS_LOG_PRIORITY_ENABLED(NActors::NLog::PRI_DEBUG, NKikimrServices::TX_COLUMNSHARD)) {
64+
auto before = Counters.Active();
65+
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
66+
auto after = Counters.Active();
67+
AFL_DEBUG(NKikimrServices::TX_COLUMNSHARD)("event", "portion_stats_updated")("type", updateType)("path_id", portionInfo.GetPathId())("portion", portionInfo.GetPortionId())("before_size", before.Bytes)("after_size", after.Bytes)("before_rows", before.Rows)("after_rows", after.Rows);
68+
} else {
69+
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
70+
}
6571
const ui64 pathId = portionInfo.GetPathId();
6672
Y_ABORT_UNLESS(pathId);
6773
if (!PathStats.contains(pathId)) {

ydb/core/tx/columnshard/engines/ya.make

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ SRCS(
1616
defs.cpp
1717
)
1818

19+
GENERATE_ENUM_SERIALIZATION(column_engine_logs.h)
20+
1921
PEERDIR(
2022
contrib/libs/apache/arrow
2123
ydb/core/base

ydb/core/tx/schemeshard/schemeshard__table_stats.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,9 @@ bool TTxStoreTableStats::PersistSingleStats(const TPathId& pathId,
248248
}
249249

250250
TShardIdx shardIdx = Self->TabletIdToShardIdx[datashardId];
251+
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,
252+
"PersistSingleStats for pathId " << pathId.LocalPathId << " shard idx " << shardIdx << " data size " << dataSize << " row count " << rowCount
253+
);
251254
const auto* shardInfo = Self->ShardInfos.FindPtr(shardIdx);
252255
if (!shardInfo) {
253256
LOG_DEBUG_S(ctx, NKikimrServices::FLAT_TX_SCHEMESHARD,

0 commit comments

Comments
 (0)