plugin/metrics: Added New func (#1309)
If external plugins wanted to extend metrics there was no way since zoneNames couldn't be initialized. Now plugins can call New to get an instance of Metrics that they can extend.
This commit is contained in:
parent
2e2e5e1bec
commit
1919913c98
3 changed files with 10 additions and 8 deletions
|
@ -13,7 +13,7 @@ import (
|
|||
)
|
||||
|
||||
func TestMetrics(t *testing.T) {
|
||||
met := &Metrics{Addr: "localhost:0", zoneMap: make(map[string]bool)}
|
||||
met := New("localhost:0")
|
||||
if err := met.OnStartup(); err != nil {
|
||||
t.Fatalf("Failed to start metrics handler: %s", err)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue