Adds a FixedPrecision Counter and Gauge
This commit is contained in:
@@ -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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user