Skip to content

Commit

Permalink
fix tsan alerts (#13722)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanmorozov333 authored Jan 22, 2025
1 parent 46d6120 commit 3c535d3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ void TFetchingScript::Allocation(const std::set<ui32>& entityIds, const EStageFe
TString IFetchingStep::DebugString() const {
TStringBuilder sb;
sb << "name=" << Name << ";duration=" << GetSumDuration() << ";"
<< "size=" << 1e-9 * SumSize << ";details={" << DoDebugString() << "};";
<< "size=" << 1e-9 * GetSumSize() << ";details={" << DoDebugString() << "};";
return sb;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class IFetchingStep: public TNonCopyable {
private:
YDB_READONLY_DEF(TString, Name);
TAtomicCounter SumDuration;
YDB_READONLY(ui64, SumSize, 0);
TAtomicCounter SumSize;
TFetchingStepSignals Signals;

protected:
Expand All @@ -82,12 +82,16 @@ class IFetchingStep: public TNonCopyable {
return TDuration::MicroSeconds(SumDuration.Val());
}

ui64 GetSumSize() const {
return SumSize.Val();
}

void AddDuration(const TDuration d) {
SumDuration.Add(d.MicroSeconds());
Signals.AddDuration(d);
}
void AddDataSize(const ui64 size) {
SumSize += size;
SumSize.Add(size);
Signals.AddBytes(size);
}

Expand Down

0 comments on commit 3c535d3

Please sign in to comment.