From 29d51d71b7181a87f096b070151a8665f6529c80 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Sat, 9 Mar 2024 03:47:52 +0300 Subject: [PATCH] Fix the name --- src/Common/ZooKeeper/ZooKeeperImpl.cpp | 22 +++++++++++----------- src/Interpreters/ZooKeeperLog.cpp | 2 +- src/Interpreters/ZooKeeperLog.h | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/Common/ZooKeeper/ZooKeeperImpl.cpp b/src/Common/ZooKeeper/ZooKeeperImpl.cpp index 9f3752ede58..55e33273d44 100644 --- a/src/Common/ZooKeeper/ZooKeeperImpl.cpp +++ b/src/Common/ZooKeeper/ZooKeeperImpl.cpp @@ -812,7 +812,7 @@ void ZooKeeper::receiveEvent() RequestInfo request_info; ZooKeeperResponsePtr response; - UInt64 elapsed_us = 0; + UInt64 elapsed_microseconds = 0; maybeInjectRecvFault(); @@ -875,8 +875,8 @@ void ZooKeeper::receiveEvent() CurrentMetrics::sub(CurrentMetrics::ZooKeeperRequest); } - elapsed_us = std::chrono::duration_cast(clock::now() - request_info.time).count(); - ProfileEvents::increment(ProfileEvents::ZooKeeperWaitMicroseconds, elapsed_us); + elapsed_microseconds = std::chrono::duration_cast(clock::now() - request_info.time).count(); + ProfileEvents::increment(ProfileEvents::ZooKeeperWaitMicroseconds, elapsed_microseconds); } try @@ -935,7 +935,7 @@ void ZooKeeper::receiveEvent() length, actual_length); } - logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_us); + logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_microseconds); } catch (...) { @@ -954,7 +954,7 @@ void ZooKeeper::receiveEvent() if (request_info.callback) request_info.callback(*response); - logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_us); + logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_microseconds); } catch (...) { @@ -1048,14 +1048,14 @@ void ZooKeeper::finalize(bool error_send, bool error_receive, const String & rea ? Error::ZCONNECTIONLOSS : Error::ZSESSIONEXPIRED; response->xid = request_info.request->xid; - UInt64 elapsed_us = std::chrono::duration_cast(clock::now() - request_info.time).count(); + UInt64 elapsed_microseconds = std::chrono::duration_cast(clock::now() - request_info.time).count(); if (request_info.callback) { try { request_info.callback(*response); - logOperationIfNeeded(request_info.request, response, true, elapsed_us); + logOperationIfNeeded(request_info.request, response, true, elapsed_microseconds); } catch (...) { @@ -1115,8 +1115,8 @@ void ZooKeeper::finalize(bool error_send, bool error_receive, const String & rea try { info.callback(*response); - UInt64 elapsed_us = std::chrono::duration_cast(clock::now() - info.time).count(); - logOperationIfNeeded(info.request, response, true, elapsed_us); + UInt64 elapsed_microseconds = std::chrono::duration_cast(clock::now() - info.time).count(); + logOperationIfNeeded(info.request, response, true, elapsed_microseconds); } catch (...) { @@ -1498,7 +1498,7 @@ void ZooKeeper::setZooKeeperLog(std::shared_ptr zk_log_) } #ifdef ZOOKEEPER_LOG -void ZooKeeper::logOperationIfNeeded(const ZooKeeperRequestPtr & request, const ZooKeeperResponsePtr & response, bool finalize, UInt64 elapsed_us) +void ZooKeeper::logOperationIfNeeded(const ZooKeeperRequestPtr & request, const ZooKeeperResponsePtr & response, bool finalize, UInt64 elapsed_microseconds) { auto maybe_zk_log = std::atomic_load(&zk_log); if (!maybe_zk_log) @@ -1536,7 +1536,7 @@ void ZooKeeper::logOperationIfNeeded(const ZooKeeperRequestPtr & request, const elem.event_time = event_time; elem.address = socket_address; elem.session_id = session_id; - elem.duration_us = elapsed_us; + elem.duration_us = elapsed_microseconds; if (request) { elem.thread_id = request->thread_id; diff --git a/src/Interpreters/ZooKeeperLog.cpp b/src/Interpreters/ZooKeeperLog.cpp index 4821773bf98..31a12a520f4 100644 --- a/src/Interpreters/ZooKeeperLog.cpp +++ b/src/Interpreters/ZooKeeperLog.cpp @@ -183,7 +183,7 @@ void ZooKeeperLogElement::appendToBlock(MutableColumns & columns) const columns[i++]->insertData(IPv6ToBinary(address.host()).data(), 16); columns[i++]->insert(address.port()); columns[i++]->insert(session_id); - columns[i++]->insert(duration_us); + columns[i++]->insert(elapsed_microseconds); columns[i++]->insert(xid); columns[i++]->insert(has_watch); diff --git a/src/Interpreters/ZooKeeperLog.h b/src/Interpreters/ZooKeeperLog.h index 8187978bd57..7afc1db39a6 100644 --- a/src/Interpreters/ZooKeeperLog.h +++ b/src/Interpreters/ZooKeeperLog.h @@ -28,7 +28,7 @@ struct ZooKeeperLogElement Poco::Net::SocketAddress address; Int64 session_id = 0; - UInt64 duration_us = 0; + UInt64 elapsed_microseconds = 0; /// Common request info Int32 xid = 0;