Skip to content

Commit

Permalink
Sensor for number of shards within single BulkUpsert data (ydb-platfo…
Browse files Browse the repository at this point in the history
  • Loading branch information
fexolm authored and dahbka-lis committed Nov 22, 2024
1 parent a3af19b commit e9fc6ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ydb/core/tx/data_events/shard_writer.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ class TCSUploadCounters: public NColumnShard::TCommonCountersOwner {
NMonitoring::THistogramPtr FailedFullReplyDuration;
NMonitoring::THistogramPtr BytesDistribution;
NMonitoring::THistogramPtr RowsDistribution;
NMonitoring::THistogramPtr ShardsCountDistribution;
NMonitoring::TDynamicCounters::TCounterPtr RowsCount;
NMonitoring::TDynamicCounters::TCounterPtr BytesCount;
NMonitoring::TDynamicCounters::TCounterPtr FailsCount;
Expand All @@ -54,6 +55,7 @@ class TCSUploadCounters: public NColumnShard::TCommonCountersOwner {
, 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"))
Expand Down Expand Up @@ -81,6 +83,10 @@ class TCSUploadCounters: public NColumnShard::TCommonCountersOwner {
FailsCount->Add(1);
}

void OnSplitByShards(const ui64 shardsCount) const {
ShardsCountDistribution->Collect(shardsCount);
}

void OnCSReply(const TDuration d) const {
CSReplyDuration->Collect(d.MilliSeconds());
}
Expand Down
2 changes: 2 additions & 0 deletions ydb/core/tx/tx_proxy/rpc_long_tx.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ class TLongTxWriteBase: public TActorBootstrapped<TLongTxWriteImpl>,
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;
Expand Down

0 comments on commit e9fc6ca

Please sign in to comment.