-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent expvars.Publish from panicing and make NewTimerWithTags threa…
…d-safe (#63) [`expvar.Publish`](https://golang.org/pkg/expvar/#Publish) panics if called if the variable name is already published (this happens because we use `expvar.Publish` incorrectly - it is only meant to be called during program init). This commit fixes this by silently ignoring duplicate calls to `expvar.Publish` with a duplicate name. `NewTimerWithTags`: re-check condition after acquiring write lock. Additionally, the `NewCounterWithTags` and `NewGaugeWithTags` code was slightly cleaned up.
- Loading branch information
1 parent
93097ca
commit afd370d
Showing
1 changed file
with
30 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters