Skip to content

Commit dd78d17

Browse files
Merge 5dbd1bf into a119eea
2 parents a119eea + 5dbd1bf commit dd78d17

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

ydb/core/persqueue/partition_write.cpp

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -472,20 +472,14 @@ void TPartition::UpdateAfterWriteCounters(bool writeComplete) {
472472
// If supportive - update counters only prior to write, otherwise - only after writes;
473473
return;
474474
}
475-
if (BytesWrittenGrpc)
476-
BytesWrittenGrpc.Inc(WriteNewSizeInternal);
477-
if (BytesWrittenTotal)
478-
BytesWrittenTotal.Inc(WriteNewSize);
479-
480-
if (BytesWrittenUncompressed)
481-
BytesWrittenUncompressed.Inc(WriteNewSizeUncompressed);
475+
BytesWrittenGrpc.Inc(WriteNewSizeInternal);
476+
BytesWrittenTotal.Inc(WriteNewSize);
477+
BytesWrittenUncompressed.Inc(WriteNewSizeUncompressed);
482478
if (BytesWrittenComp)
483479
BytesWrittenComp.Inc(WriteCycleSize);
484-
if (MsgsWrittenGrpc)
485-
MsgsWrittenGrpc.Inc(WriteNewMessagesInternal);
486-
if (MsgsWrittenTotal) {
487-
MsgsWrittenTotal.Inc(WriteNewMessages);
488-
}
480+
481+
MsgsWrittenGrpc.Inc(WriteNewMessagesInternal);
482+
MsgsWrittenTotal.Inc(WriteNewMessages);
489483
}
490484

491485
void TPartition::HandleWriteResponse(const TActorContext& ctx) {

ydb/core/persqueue/percentile_counter.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ NKikimr::NPQ::TPercentileCounter CreateSLIDurationCounter(
131131
return NKikimr::NPQ::TPercentileCounter(counters->GetSubgroup("sensor", name), aggr, {}, "Duration", buckets, true, false);
132132
}
133133

134+
TPartitionCounterWrapper::TPartitionCounterWrapper()
135+
: DoSave(false)
136+
, DoReport(false)
137+
{
138+
}
139+
134140
TPartitionCounterWrapper::TPartitionCounterWrapper(NKikimr::NPQ::TMultiCounter&& counter, bool isSupportivePartition, bool doReport) {
135141
Setup(isSupportivePartition, doReport, std::move(counter));
136142
}
@@ -177,6 +183,9 @@ void TPartitionHistogramWrapper::Setup(bool isSupportivePartition, std::unique_p
177183
}
178184
}
179185
void TPartitionHistogramWrapper::IncFor(ui64 key, ui64 value) {
186+
if (!Inited)
187+
return;
188+
180189
if (!IsSupportivePartition) {
181190
return Histogram->IncFor(key, value);
182191
}

ydb/core/persqueue/percentile_counter.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class TPartitionCounterWrapper {
6666
bool Inited = false;
6767

6868
public:
69-
TPartitionCounterWrapper() = default;
69+
TPartitionCounterWrapper();
7070
explicit TPartitionCounterWrapper(NKikimr::NPQ::TMultiCounter&& counter, bool isSupportivePartition, bool doReport = true);
7171
void Setup(bool isSupportivePartition, bool doReport, NKikimr::NPQ::TMultiCounter&& counter);
7272
void Inc(ui64 value);

0 commit comments

Comments
 (0)