Skip to content

Commit

Permalink
Table stats log stable (ydb-platform#10162)
Browse files Browse the repository at this point in the history
  • Loading branch information
aavdonkin authored Oct 8, 2024
1 parent 4474686 commit fa36fbe
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ydb/core/tx/columnshard/engines/column_engine_logs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,14 @@ const TColumnEngineStats& TColumnEngineForLogs::GetTotalStats() {

void TColumnEngineForLogs::UpdatePortionStats(const TPortionInfo& portionInfo, EStatsUpdateType updateType,
const TPortionInfo* exPortionInfo) {
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);

if (IS_LOG_PRIORITY_ENABLED(NActors::NLog::PRI_DEBUG, NKikimrServices::TX_COLUMNSHARD)) {
auto before = Counters.Active();
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
auto after = Counters.Active();
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);
} else {
UpdatePortionStats(Counters, portionInfo, updateType, exPortionInfo);
}
const ui64 pathId = portionInfo.GetPathId();
Y_ABORT_UNLESS(pathId);
if (!PathStats.contains(pathId)) {
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/tx/columnshard/engines/ya.make
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ SRCS(
defs.cpp
)

GENERATE_ENUM_SERIALIZATION(column_engine_logs.h)

PEERDIR(
contrib/libs/apache/arrow
ydb/core/base
Expand Down
3 changes: 3 additions & 0 deletions ydb/core/tx/schemeshard/schemeshard__table_stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,9 @@ bool TTxStoreTableStats::PersistSingleStats(const TPathId& pathId,
}

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

0 comments on commit fa36fbe

Please sign in to comment.