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

metrics,server: add a get_token_duration_seconds metrics #7110

Merged
merged 8 commits into from
Jul 23, 2018

Conversation

tiancaiamao
Copy link
Contributor

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.

image

What is the type of the changes? (mandatory)

  • Improvement (non-breaking change which is an improvement to an existing feature)

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.

@shenli
Copy link
Member

shenli commented Jul 19, 2018

LGTM

@shenli shenli added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 19, 2018
zz-jason
zz-jason previously approved these changes Jul 20, 2018
Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zz-jason zz-jason added status/LGT2 Indicates that a PR has LGTM 2. and removed status/LGT1 Indicates that a PR has LGTM 1. labels Jul 20, 2018
server/server.go Outdated
return s.concurrentLimiter.Get()
start := time.Now()
tok := s.concurrentLimiter.Get()
metrics.GetTokenDurationHistogram.Observe(time.Since(start).Seconds())
Copy link
Member

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?

@tiancaiamao
Copy link
Contributor Author

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)))
Copy link
Member

@ngaut ngaut Jul 23, 2018

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.

@tiancaiamao
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@crazycs520 crazycs520 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ciscoxll
Copy link
Contributor

/run-integration-ddl-test

Copy link
Contributor

@ciscoxll ciscoxll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ciscoxll ciscoxll merged commit a7ae09b into pingcap:master Jul 23, 2018
@tiancaiamao tiancaiamao deleted the get-token-metrics branch July 23, 2018 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/metrics status/LGT2 Indicates that a PR has LGTM 2.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants