mirror of
https://git.vectorsigma.ru/public/atlantis.git
synced 2026-08-02 19:58:47 +00:00
22 lines
369 B
Go
22 lines
369 B
Go
package metrics
|
|
|
|
import (
|
|
"testing"
|
|
|
|
tally "github.com/uber-go/tally/v4"
|
|
)
|
|
|
|
func TestInitCounter(t *testing.T) {
|
|
scope := tally.NewTestScope("test", nil)
|
|
|
|
InitCounter(scope, "counter")
|
|
|
|
counter, ok := scope.Snapshot().Counters()["test.counter+"]
|
|
if !ok {
|
|
t.Errorf("Counter not found")
|
|
}
|
|
if counter.Value() != 0 {
|
|
t.Errorf("Counter is not initialized")
|
|
}
|
|
}
|