Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update slow request threshold #205

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Service/ConnectionHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -702,10 +702,10 @@ void ConnectionHandler::updateStats(const Coordination::ZooKeeperResponsePtr & r
{
std::lock_guard lock(conn_stats_mutex);
conn_stats.updateLatency(elapsed);
if (elapsed > 1000)
if (unlikely(elapsed > 10000))
LOG_WARNING(
log,
"The processing time for request #{}#{}#{} is {}ms, which is a little long.",
"The processing time for request #{}#{}#{} is {}ms, which is a little long, please take care.",
toHexString(session_id.load()),
response->xid,
Coordination::toString(response->getOpNum()),
Expand Down
8 changes: 4 additions & 4 deletions src/Service/NuRaftStateMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ nuraft::ptr<nuraft::buffer> NuRaftStateMachine::commit(const ulong log_idx, nura
{
LOG_TRACE(log, "Begin commit log index {}", log_idx);

if (isNewSessionRequest(data))
if (isNewSessionRequest(data)) /// TODO remove in future
{
nuraft::buffer_serializer timeout_data(data);
int64_t session_timeout_ms = timeout_data.get_i64();
Expand Down Expand Up @@ -273,7 +273,7 @@ nuraft::ptr<nuraft::buffer> NuRaftStateMachine::commit(const ulong log_idx, nura

return response;
}
else if (isUpdateSessionRequest(data))
else if (isUpdateSessionRequest(data)) /// TODO remove in future
{
nuraft::buffer_serializer data_serializer(data);
int64_t session_id = data_serializer.get_i64();
Expand Down Expand Up @@ -312,10 +312,10 @@ nuraft::ptr<nuraft::buffer> NuRaftStateMachine::commit(const ulong log_idx, nura
if (request_for_session.create_time > 0)
{
Int64 elapsed = Poco::Timestamp().epochMicroseconds() / 1000 - request_for_session.create_time;
if (elapsed > 1000)
if (unlikely(elapsed > 10000))
LOG_WARNING(
log,
"When committing log {} for request {}, the time has passed {}ms, it is a little long.",
"When committing log {} for request {}, the time has passed {}ms, which is a little long, please take care.",
log_idx,
request_for_session.toSimpleString(),
elapsed);
Expand Down
Loading