6#include <userver/ydb/query.hpp>
15class StatsScope
final {
17 struct TransactionTag {};
19 StatsScope(Stats& stats,
const Query& query);
20 StatsScope(TransactionTag, Stats& stats,
const std::string& tx_name);
22 StatsScope(StatsScope&&)
noexcept;
25 void OnError()
noexcept;
26 void OnCancelled()
noexcept;
29 explicit StatsScope(StatsCounters&);
31 StatsCounters& stats_;
32 const std::chrono::steady_clock::time_point start_;
33 bool is_active_{
true};
34 bool is_error_{
false};
35 bool is_cancelled_{
false};