-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
metrics,server: add a get_token_duration_seconds metrics #7110
Conversation
LGTM |
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.
LGTM
server/server.go
Outdated
return s.concurrentLimiter.Get() | ||
start := time.Now() | ||
tok := s.concurrentLimiter.Get() | ||
metrics.GetTokenDurationHistogram.Observe(time.Since(start).Seconds()) |
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.
Could you use million seconds?
PTAL @ngaut |
server/server.go
Outdated
func (s *Server) getToken() *Token { | ||
start := time.Now() | ||
tok := s.concurrentLimiter.Get() | ||
metrics.GetTokenDurationHistogram.Observe(time.Since(start).Seconds()) | ||
metrics.GetTokenDurationHistogram.Observe(durationToMilliseconds(time.Since(start))) |
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.
time.Since().Nanoseconds/1000 should be enough.
/run-all-tests |
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.
LGTM
/run-integration-ddl-test |
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.
LGTM
What have you changed? (mandatory)
Add a metrics
get_token_duration_seconds
, if concurrent limit is reached, we should be able see blocking on get token.What is the type of the changes? (mandatory)
How has this PR been tested? (mandatory)
Does this PR affect documentation (docs/docs-cn) update? (mandatory)
No
Does this PR affect tidb-ansible update? (mandatory)
Later I'll update tidb-ansible grafana script.