diff options
author | Artem Alekseev <fexolm@ydb.tech> | 2024-11-21 11:45:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-21 11:45:36 +0300 |
commit | 0d8f95e0eef61b2cbb1029b388c7694021535ce0 (patch) | |
tree | 134b1aa5bd786da79b7af632205ba31a6f0ffa1c | |
parent | 1b00f6afcb58567aa0a874f854813fcf252cf2e9 (diff) | |
download | ydb-0d8f95e0eef61b2cbb1029b388c7694021535ce0.tar.gz |
Sensor for number of shards within single BulkUpsert data (#11786)
-rw-r--r-- | ydb/core/tx/data_events/shard_writer.h | 6 | ||||
-rw-r--r-- | ydb/core/tx/tx_proxy/rpc_long_tx.cpp | 2 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ydb/core/tx/data_events/shard_writer.h b/ydb/core/tx/data_events/shard_writer.h index 57c64c786f..b3c53d3d36 100644 --- a/ydb/core/tx/data_events/shard_writer.h +++ b/ydb/core/tx/data_events/shard_writer.h @@ -39,6 +39,7 @@ private: NMonitoring::THistogramPtr FailedFullReplyDuration; NMonitoring::THistogramPtr BytesDistribution; NMonitoring::THistogramPtr RowsDistribution; + NMonitoring::THistogramPtr ShardsCountDistribution; NMonitoring::TDynamicCounters::TCounterPtr RowsCount; NMonitoring::TDynamicCounters::TCounterPtr BytesCount; NMonitoring::TDynamicCounters::TCounterPtr FailsCount; @@ -54,6 +55,7 @@ public: , FailedFullReplyDuration(TBase::GetHistogram("Replies/Failed/Full/DurationMs", NMonitoring::ExponentialHistogram(15, 2, 10))) , BytesDistribution(TBase::GetHistogram("Requests/Bytes", NMonitoring::ExponentialHistogram(15, 2, 1024))) , RowsDistribution(TBase::GetHistogram("Requests/Rows", NMonitoring::ExponentialHistogram(15, 2, 16))) + , ShardsCountDistribution(TBase::GetHistogram("Requests/ShardSplits", NMonitoring::LinearHistogram(50, 1, 1))) , RowsCount(TBase::GetDeriviative("Rows")) , BytesCount(TBase::GetDeriviative("Bytes")) , FailsCount(TBase::GetDeriviative("Fails")) @@ -81,6 +83,10 @@ public: FailsCount->Add(1); } + void OnSplitByShards(const ui64 shardsCount) const { + ShardsCountDistribution->Collect(shardsCount); + } + void OnCSReply(const TDuration d) const { CSReplyDuration->Collect(d.MilliSeconds()); } diff --git a/ydb/core/tx/tx_proxy/rpc_long_tx.cpp b/ydb/core/tx/tx_proxy/rpc_long_tx.cpp index aaefb6e564..b1479c92d2 100644 --- a/ydb/core/tx/tx_proxy/rpc_long_tx.cpp +++ b/ydb/core/tx/tx_proxy/rpc_long_tx.cpp @@ -98,6 +98,8 @@ protected: const auto& splittedData = shardsSplitter->GetSplitData(); InternalController = std::make_shared<NEvWrite::TWritersController>(splittedData.GetShardRequestsCount(), this->SelfId(), LongTxId, NoTxWrite); + + InternalController->GetCounters()->OnSplitByShards(splittedData.GetShardsCount()); ui32 sumBytes = 0; ui32 rowsCount = 0; ui32 writeIdx = 0; |