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

Stop timer/meter #206

Merged
merged 6 commits into from
Nov 28, 2017
Merged

Stop timer/meter #206

merged 6 commits into from
Nov 28, 2017

Conversation

inooka-shiroyuki
Copy link
Contributor

based on #197

  • added Stop to timer.
  • call Stop when metrics are unregistered.
  • use lock in meter Stop() to avoid data races accessing the stopped flag.
  • when called meter Mark(), return if meter is already stopped (without panicking).

@imkira imkira mentioned this pull request Jul 9, 2017
slaunay and others added 2 commits September 2, 2017 15:36
- use map[*StandardMeter]struct{} instead of map[int64]*StandardMeter
  to avoid id management pitfalls
- update documentation and examples
Use set of meters and update documentation
@mihasya
Copy link
Collaborator

mihasya commented Sep 25, 2017

(am in the middle of a bunch of travel and a conference, will try to take a look soon.. leaving the tab open)

Copy link
Collaborator

@mihasya mihasya left a comment

Choose a reason for hiding this comment

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

👍

Approving with small change in comment

@@ -227,7 +258,7 @@ func (ma *meterArbiter) tick() {
func (ma *meterArbiter) tickMeters() {
ma.RLock()
defer ma.RUnlock()
for _, meter := range ma.meters {
for meter := range ma.meters {
Copy link
Collaborator

Choose a reason for hiding this comment

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

doesn't this syntax only work in newer Go? I would leave it as is to avoid breaking bw compatibility.

Edit: I see tests pass on all the old versions, disregard.

@mihasya mihasya merged commit 39aa482 into rcrowley:master Nov 28, 2017
@inooka-shiroyuki
Copy link
Contributor Author

@mihasya thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants