-
Notifications
You must be signed in to change notification settings - Fork 720
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
*: add a log when getting timestamps are too slow #1863
Conversation
Signed-off-by: Ryan Leung <rleungx@gmail.com>
server/grpc_service.go
Outdated
@@ -87,6 +87,11 @@ func (s *Server) Tso(stream pdpb.PD_TsoServer) error { | |||
if err != nil { | |||
return status.Errorf(codes.Unknown, err.Error()) | |||
} | |||
|
|||
elapsed := time.Since(start) | |||
if elapsed > time.Second { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1s is too long. Consider 1ms?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I doubt if it will too noisy?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did a test and found the cost time was only several microseconds. So I change it to 1ms.
Signed-off-by: Ryan Leung <rleungx@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #1863 +/- ##
=========================================
Coverage ? 77.89%
=========================================
Files ? 169
Lines ? 16990
Branches ? 0
=========================================
Hits ? 13235
Misses ? 2691
Partials ? 1064
Continue to review full report at Codecov.
|
/run-all-tests |
@rleungx merge failed. |
Signed-off-by: Ryan Leung <rleungx@gmail.com>
cherry pick to release-2.1 in PR #1866 |
cherry pick to release-3.0 in PR #1867 |
cherry pick to release-3.1 in PR #1868 |
What problem does this PR solve?
To make clear about whether the server is slow or the network is slow when getting timestamps.
What is changed and how it works?
This PR will print a log when the cost time of getting timestamps is more than one second.
Check List
Tests
Related changes