chore(*): make everything use goven
for i in github.com/BurntSushi/toml github.com/coreos/go-etcd/etcd github.com/coreos/go-log/log github.com/gorilla/context github.com/rcrowley/go-metrics bitbucket.org/kardianos/osext github.com/coreos/go-systemd/journal github.com/coreos/raft code.google.com/p/goprotobuf/proto ; do goven -copy -rewrite $i; done
This commit is contained in:
37
third_party/github.com/rcrowley/go-metrics/gauge_test.go
vendored
Normal file
37
third_party/github.com/rcrowley/go-metrics/gauge_test.go
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
package metrics
|
||||
|
||||
import "testing"
|
||||
|
||||
func BenchmarkGuage(b *testing.B) {
|
||||
g := NewGauge()
|
||||
b.ResetTimer()
|
||||
for i := 0; i < b.N; i++ {
|
||||
g.Update(int64(i))
|
||||
}
|
||||
}
|
||||
|
||||
func TestGauge(t *testing.T) {
|
||||
g := NewGauge()
|
||||
g.Update(int64(47))
|
||||
if v := g.Value(); 47 != v {
|
||||
t.Errorf("g.Value(): 47 != %v\n", v)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGaugeSnapshot(t *testing.T) {
|
||||
g := NewGauge()
|
||||
g.Update(int64(47))
|
||||
snapshot := g.Snapshot()
|
||||
g.Update(int64(0))
|
||||
if v := snapshot.Value(); 47 != v {
|
||||
t.Errorf("g.Value(): 47 != %v\n", v)
|
||||
}
|
||||
}
|
||||
|
||||
func TestGetOrRegisterGauge(t *testing.T) {
|
||||
r := NewRegistry()
|
||||
NewRegisteredGauge("foo", r).Update(47)
|
||||
if g := GetOrRegisterGauge("foo", r); 47 != g.Value() {
|
||||
t.Fatal(g)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user