collection of high-performance prometheus counters
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

interface_test.go 560B

123456789101112131415161718192021222324252627282930313233
  1. package prom
  2. import (
  3. "testing"
  4. "github.com/prometheus/client_golang/prometheus"
  5. )
  6. func TestGauginess(t *testing.T) {
  7. g := NewGauge(prometheus.GaugeOpts{
  8. Name: "test",
  9. Help: "test help",
  10. }, 3)
  11. switch g.(type) {
  12. case prometheus.Gauge:
  13. default:
  14. t.Fatalf("FixedPrecision is not a prometheus.Gauge")
  15. }
  16. }
  17. func TestCounteriness(t *testing.T) {
  18. c := NewCounter(prometheus.CounterOpts{
  19. Name: "test",
  20. Help: "test help",
  21. }, 3)
  22. switch c.(type) {
  23. case prometheus.Counter:
  24. default:
  25. t.Fatalf("FixedPrecision is not a prometheus.Counter")
  26. }
  27. }