File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
ydb/core/tx/columnshard/engines/reader/common_reader/iterator Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -79,8 +79,8 @@ TString TFetchingScript::DebugString() const {
7979 return " " ;
8080 }
8181 sb << " {branch:" << BranchName << " ;" ;
82- if (FinishInstant && StartInstant) {
83- sb << " duration:" << * FinishInstant - * StartInstant << " ;" ;
82+ if (AtomicGet ( FinishInstant) && AtomicGet ( StartInstant) ) {
83+ sb << " duration:" << AtomicGet ( FinishInstant) - AtomicGet ( StartInstant) << " ;" ;
8484 }
8585
8686 sb << " steps_10Ms:[" << sbBranch << " ]}" ;
Original file line number Diff line number Diff line change @@ -109,8 +109,8 @@ class TFetchingScript {
109109private:
110110 YDB_ACCESSOR (TString, BranchName, " UNDEFINED" );
111111 std::vector<std::shared_ptr<IFetchingStep>> Steps;
112- std::optional<TMonotonic> StartInstant;
113- std::optional<TMonotonic> FinishInstant;
112+ TAtomic StartInstant;
113+ TAtomic FinishInstant;
114114
115115public:
116116 TFetchingScript (const TSpecialReadContext& context);
@@ -122,14 +122,12 @@ class TFetchingScript {
122122 }
123123
124124 void AddStepDuration (const ui32 index, const TDuration d) {
125- FinishInstant = TMonotonic::Now ();
125+ AtomicSet ( FinishInstant, TMonotonic::Now (). MicroSeconds () );
126126 GetStep (index)->AddDuration (d);
127127 }
128128
129129 void OnExecute () {
130- if (!StartInstant) {
131- StartInstant = TMonotonic::Now ();
132- }
130+ AtomicCas (&StartInstant, TMonotonic::Now ().MicroSeconds (), 0 );
133131 }
134132
135133 TString DebugString () const ;
You can’t perform that action at this time.
0 commit comments