Adds a FixedPrecision Counter and Gauge

This commit is contained in:
sm
2017-12-13 17:48:03 -08:00
parent ab31273ace
commit 2cf055074f
3 changed files with 317 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
package prom
import (
"testing"
"github.com/prometheus/client_golang/prometheus"
)
func TestGauginess(t *testing.T) {
g := NewGauge(prometheus.GaugeOpts{
Name: "test",
Help: "test help",
}, 3)
switch g.(type) {
case prometheus.Gauge:
default:
t.Fatalf("FixedPrecision is not a prometheus.Gauge")
}
}
func TestCounteriness(t *testing.T) {
c := NewCounter(prometheus.CounterOpts{
Name: "test",
Help: "test help",
}, 3)
switch c.(type) {
case prometheus.Counter:
default:
t.Fatalf("FixedPrecision is not a prometheus.Counter")
}
}