mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-22 17:50:47 +00:00
ZooKeeper: more instrumentation [#CLICKHOUSE-2]
This commit is contained in:
parent
788d8e740d
commit
8029a9b579
@ -67,6 +67,8 @@
|
||||
M(ZooKeeperClose) \
|
||||
M(ZooKeeperExceptions) \
|
||||
M(ZooKeeperWaitMicroseconds) \
|
||||
M(ZooKeeperBytesSent) \
|
||||
M(ZooKeeperBytesReceived) \
|
||||
\
|
||||
M(DistributedConnectionFailTry) \
|
||||
M(DistributedConnectionMissingTable) \
|
||||
|
@ -37,6 +37,8 @@ namespace ProfileEvents
|
||||
extern const Event ZooKeeperCheck;
|
||||
extern const Event ZooKeeperClose;
|
||||
extern const Event ZooKeeperWaitMicroseconds;
|
||||
extern const Event ZooKeeperBytesSent;
|
||||
extern const Event ZooKeeperBytesReceived;
|
||||
}
|
||||
|
||||
namespace CurrentMetrics
|
||||
@ -688,6 +690,8 @@ void ZooKeeper::sendThread()
|
||||
{
|
||||
while (!expired)
|
||||
{
|
||||
auto prev_bytes_sent = out->count();
|
||||
|
||||
auto now = clock::now();
|
||||
auto next_heartbeat_time = prev_heartbeat_time + std::chrono::milliseconds(session_timeout.totalMilliseconds() / 3);
|
||||
|
||||
@ -716,6 +720,8 @@ void ZooKeeper::sendThread()
|
||||
request.xid = ping_xid;
|
||||
request.write(*out);
|
||||
}
|
||||
|
||||
ProfileEvents::increment(ProfileEvents::ZooKeeperBytesSent, out->count() - prev_bytes_sent);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
@ -738,6 +744,8 @@ void ZooKeeper::receiveThread()
|
||||
Int64 waited = 0;
|
||||
while (!expired)
|
||||
{
|
||||
auto prev_bytes_received = in->count();
|
||||
|
||||
clock::time_point now = clock::now();
|
||||
UInt64 max_wait = operation_timeout.totalMicroseconds();
|
||||
bool has_operations = false;
|
||||
@ -772,6 +780,8 @@ void ZooKeeper::receiveThread()
|
||||
throw Exception("Nothing is received in session timeout", ZOPERATIONTIMEOUT);
|
||||
|
||||
}
|
||||
|
||||
ProfileEvents::increment(ProfileEvents::ZooKeeperBytesReceived, in->count() - prev_bytes_received);
|
||||
}
|
||||
}
|
||||
catch (...)
|
||||
|
Loading…
Reference in New Issue
Block a user