mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Fix the name
This commit is contained in:
parent
271342a871
commit
29d51d71b7
@ -812,7 +812,7 @@ void ZooKeeper::receiveEvent()
|
|||||||
|
|
||||||
RequestInfo request_info;
|
RequestInfo request_info;
|
||||||
ZooKeeperResponsePtr response;
|
ZooKeeperResponsePtr response;
|
||||||
UInt64 elapsed_us = 0;
|
UInt64 elapsed_microseconds = 0;
|
||||||
|
|
||||||
maybeInjectRecvFault();
|
maybeInjectRecvFault();
|
||||||
|
|
||||||
@ -875,8 +875,8 @@ void ZooKeeper::receiveEvent()
|
|||||||
CurrentMetrics::sub(CurrentMetrics::ZooKeeperRequest);
|
CurrentMetrics::sub(CurrentMetrics::ZooKeeperRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
elapsed_us = std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - request_info.time).count();
|
elapsed_microseconds = std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - request_info.time).count();
|
||||||
ProfileEvents::increment(ProfileEvents::ZooKeeperWaitMicroseconds, elapsed_us);
|
ProfileEvents::increment(ProfileEvents::ZooKeeperWaitMicroseconds, elapsed_microseconds);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
@ -935,7 +935,7 @@ void ZooKeeper::receiveEvent()
|
|||||||
length, actual_length);
|
length, actual_length);
|
||||||
}
|
}
|
||||||
|
|
||||||
logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_us);
|
logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_microseconds);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -954,7 +954,7 @@ void ZooKeeper::receiveEvent()
|
|||||||
if (request_info.callback)
|
if (request_info.callback)
|
||||||
request_info.callback(*response);
|
request_info.callback(*response);
|
||||||
|
|
||||||
logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_us);
|
logOperationIfNeeded(request_info.request, response, /* finalize= */ false, elapsed_microseconds);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -1048,14 +1048,14 @@ void ZooKeeper::finalize(bool error_send, bool error_receive, const String & rea
|
|||||||
? Error::ZCONNECTIONLOSS
|
? Error::ZCONNECTIONLOSS
|
||||||
: Error::ZSESSIONEXPIRED;
|
: Error::ZSESSIONEXPIRED;
|
||||||
response->xid = request_info.request->xid;
|
response->xid = request_info.request->xid;
|
||||||
UInt64 elapsed_us = std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - request_info.time).count();
|
UInt64 elapsed_microseconds = std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - request_info.time).count();
|
||||||
|
|
||||||
if (request_info.callback)
|
if (request_info.callback)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
request_info.callback(*response);
|
request_info.callback(*response);
|
||||||
logOperationIfNeeded(request_info.request, response, true, elapsed_us);
|
logOperationIfNeeded(request_info.request, response, true, elapsed_microseconds);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -1115,8 +1115,8 @@ void ZooKeeper::finalize(bool error_send, bool error_receive, const String & rea
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
info.callback(*response);
|
info.callback(*response);
|
||||||
UInt64 elapsed_us = std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - info.time).count();
|
UInt64 elapsed_microseconds = std::chrono::duration_cast<std::chrono::microseconds>(clock::now() - info.time).count();
|
||||||
logOperationIfNeeded(info.request, response, true, elapsed_us);
|
logOperationIfNeeded(info.request, response, true, elapsed_microseconds);
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
@ -1498,7 +1498,7 @@ void ZooKeeper::setZooKeeperLog(std::shared_ptr<DB::ZooKeeperLog> zk_log_)
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ZOOKEEPER_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);
|
auto maybe_zk_log = std::atomic_load(&zk_log);
|
||||||
if (!maybe_zk_log)
|
if (!maybe_zk_log)
|
||||||
@ -1536,7 +1536,7 @@ void ZooKeeper::logOperationIfNeeded(const ZooKeeperRequestPtr & request, const
|
|||||||
elem.event_time = event_time;
|
elem.event_time = event_time;
|
||||||
elem.address = socket_address;
|
elem.address = socket_address;
|
||||||
elem.session_id = session_id;
|
elem.session_id = session_id;
|
||||||
elem.duration_us = elapsed_us;
|
elem.duration_us = elapsed_microseconds;
|
||||||
if (request)
|
if (request)
|
||||||
{
|
{
|
||||||
elem.thread_id = request->thread_id;
|
elem.thread_id = request->thread_id;
|
||||||
|
@ -183,7 +183,7 @@ void ZooKeeperLogElement::appendToBlock(MutableColumns & columns) const
|
|||||||
columns[i++]->insertData(IPv6ToBinary(address.host()).data(), 16);
|
columns[i++]->insertData(IPv6ToBinary(address.host()).data(), 16);
|
||||||
columns[i++]->insert(address.port());
|
columns[i++]->insert(address.port());
|
||||||
columns[i++]->insert(session_id);
|
columns[i++]->insert(session_id);
|
||||||
columns[i++]->insert(duration_us);
|
columns[i++]->insert(elapsed_microseconds);
|
||||||
|
|
||||||
columns[i++]->insert(xid);
|
columns[i++]->insert(xid);
|
||||||
columns[i++]->insert(has_watch);
|
columns[i++]->insert(has_watch);
|
||||||
|
@ -28,7 +28,7 @@ struct ZooKeeperLogElement
|
|||||||
Poco::Net::SocketAddress address;
|
Poco::Net::SocketAddress address;
|
||||||
Int64 session_id = 0;
|
Int64 session_id = 0;
|
||||||
|
|
||||||
UInt64 duration_us = 0;
|
UInt64 elapsed_microseconds = 0;
|
||||||
|
|
||||||
/// Common request info
|
/// Common request info
|
||||||
Int32 xid = 0;
|
Int32 xid = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user