forked from rcrowley/go-metrics
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Return an error from Register and disallow dupes
This is a change to the interface that will appear as a breaking change for authors of Registry implementations. The change was made in support of the change described below. rcrowley/go-tigertonic#60 points out that metrics can be reregistered causing the original metric to be lost. This patch change the Registry interface's Register method to return an error and implements this change in StandardRegistry.Register and Register. StandardRegistry.Register (and therefore Register) returns a DuplicateMetric error if a name is already registered.
- Loading branch information
Showing
2 changed files
with
44 additions
and
8 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
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