-
Notifications
You must be signed in to change notification settings - Fork 610
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
171 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 0 additions & 41 deletions
41
ydb/core/tx/columnshard/counters/aggregation/table_stats.cpp
This file was deleted.
Oops, something went wrong.
46 changes: 29 additions & 17 deletions
46
ydb/core/tx/columnshard/counters/aggregation/table_stats.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,49 @@ | ||
#pragma once | ||
|
||
#include <ydb/core/tx/columnshard/counters/scan.h> | ||
#include <ydb/core/protos/table_stats.pb.h> | ||
#include <ydb/core/tablet_flat/tablet_flat_executor.h> | ||
#include <ydb/core/tx/columnshard/counters/column_tables.h> | ||
#include <ydb/core/tx/columnshard/counters/tablet_counters.h> | ||
#include <ydb/core/tx/columnshard/counters/background_controller.h> | ||
#include <ydb/core/tx/columnshard/counters/counters_manager.h> | ||
#include <ydb/core/tx/columnshard/engines/column_engine.h> | ||
#include <ydb/core/protos/table_stats.pb.h> | ||
|
||
namespace NKikimr::NColumnShard { | ||
|
||
class TTableStatsBuilder { | ||
private: | ||
::NKikimrTableStats::TTableStats& TableStats; | ||
TCountersManager& Counters; | ||
const NTabletFlatExecutor::NFlatExecutorSetup::IExecutor& Executor; | ||
NOlap::IColumnEngine& ColumnEngine; | ||
|
||
public: | ||
TTableStatsBuilder(::NKikimrTableStats::TTableStats& tableStats) | ||
: TableStats(tableStats) { | ||
TTableStatsBuilder( | ||
TCountersManager& counters, const NTabletFlatExecutor::NFlatExecutorSetup::IExecutor* executor, NOlap::IColumnEngine& columnEngine) | ||
: Counters(counters) | ||
, Executor(*executor) | ||
, ColumnEngine(columnEngine) { | ||
} | ||
|
||
void FillColumnTableStats(const TSingleColumnTableCounters& stats); | ||
void FillColumnTableStats(const TColumnTablesCounters& stats); | ||
|
||
void FillTabletStats(const TTabletCountersHandle& stats); | ||
void FillTableStats(ui64 pathId, ::NKikimrTableStats::TTableStats& tableStats) { | ||
Counters.FillTableStats(pathId, tableStats); | ||
|
||
void FillBackgroundControllerStats(const TBackgroundControllerCounters& stats, ui64 pathId); | ||
void FillBackgroundControllerStats(const TBackgroundControllerCounters& stats); | ||
auto columnEngineStats = ColumnEngine.GetStats().FindPtr(pathId); | ||
if (columnEngineStats && *columnEngineStats) { | ||
auto activeStats = (*columnEngineStats)->Active(); | ||
tableStats.SetRowCount(activeStats.Rows); | ||
tableStats.SetDataSize(activeStats.Bytes); | ||
tableStats.SetPartCount(activeStats.Portions); | ||
} | ||
} | ||
|
||
void FillScanCountersStats(const TScanCounters& stats); | ||
void FillTotalTableStats(::NKikimrTableStats::TTableStats& tableStats) { | ||
Counters.FillTotalTableStats(tableStats); | ||
|
||
void FillExecutorStats(const NTabletFlatExecutor::NFlatExecutorSetup::IExecutor& executor); | ||
tableStats.SetInFlightTxCount(Executor.GetStats().TxInFly); | ||
tableStats.SetHasLoanedParts(Executor.HasLoanedParts()); | ||
|
||
void FillColumnEngineStats(const NOlap::TColumnEngineStats& stats); | ||
auto activeStats = ColumnEngine.GetTotalStats().Active(); | ||
tableStats.SetRowCount(activeStats.Rows); | ||
tableStats.SetDataSize(activeStats.Bytes); | ||
tableStats.SetPartCount(activeStats.Portions); | ||
} | ||
}; | ||
|
||
} // namespace NKikimr::NColumnShard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,6 @@ | ||
LIBRARY() | ||
|
||
SRCS( | ||
table_stats.cpp | ||
) | ||
SRCS() | ||
|
||
PEERDIR( | ||
ydb/core/protos | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.