diff --git a/src/Interpreters/QueryLogMetric.cpp b/src/Interpreters/QueryLogMetric.cpp index 556be89c4c3..22a33eba522 100644 --- a/src/Interpreters/QueryLogMetric.cpp +++ b/src/Interpreters/QueryLogMetric.cpp @@ -103,7 +103,7 @@ void QueryLogMetric::startQuery(const String & query_id, TimePoint query_start_t queries.emplace(std::move(status)); // Wake up the sleeping thread only if the collection for this query needs to wake up sooner - const auto & queries_by_next_collect_time = queries.get(); + const auto & queries_by_next_collect_time = queries.get(); if (query_id == queries_by_next_collect_time.begin()->query_id) { std::unique_lock cv_lock(queries_cv_mutex); @@ -114,7 +114,7 @@ void QueryLogMetric::startQuery(const String & query_id, TimePoint query_start_t void QueryLogMetric::finishQuery(const String & query_id) { std::lock_guard lock(queries_mutex); - auto & queries_by_name = queries.get(); + auto & queries_by_name = queries.get(); queries_by_name.erase(query_id); } @@ -131,7 +131,7 @@ void QueryLogMetric::threadFunction() const auto current_time = std::chrono::system_clock::now(); if (!queries.empty()) { - auto & queries_by_next_collect_time = queries.get(); + auto & queries_by_next_collect_time = queries.get(); stepFunction(current_time); desired_timepoint = queries_by_next_collect_time.begin()->next_collect_time; } @@ -184,7 +184,7 @@ void QueryLogMetric::stepFunction(TimePoint current_time) { static const auto & process_list = context->getProcessList(); - auto & queries_by_next_collect_time = queries.get(); + auto & queries_by_next_collect_time = queries.get(); for (const auto & query_status : queries_by_next_collect_time) { // The queries are already sorted by next_collect_time, so once we find a query with a next_collect_time diff --git a/src/Interpreters/QueryLogMetric.h b/src/Interpreters/QueryLogMetric.h index 4c966563e68..d4ef95d98a8 100644 --- a/src/Interpreters/QueryLogMetric.h +++ b/src/Interpreters/QueryLogMetric.h @@ -56,14 +56,14 @@ class QueryLogMetric : public PeriodicLog using PeriodicLog::PeriodicLog; public: - struct by_query_id{}; - struct by_next_collect_time{}; + struct ByQueryId{}; + struct ByNextCollectTime{}; using QuerySet = boost::multi_index_container< QueryLogMetricStatus, boost::multi_index::indexed_by< - boost::multi_index::hashed_unique, boost::multi_index::member>, - boost::multi_index::ordered_non_unique, boost::multi_index::member>>>; + boost::multi_index::hashed_unique, boost::multi_index::member>, + boost::multi_index::ordered_non_unique, boost::multi_index::member>>>; // Both startQuery and finishQuery are called from the thread that executes the query void startQuery(const String & query_id, TimePoint query_start_time, UInt64 interval_milliseconds);