github.com/safedep/dry@v0.0.0-20241016050132-a15651f0548b/obs/metrics_prom_test.go (about)

     1  package obs
     2  
     3  import "testing"
     4  
     5  func TestPrometheusMetricsProvider(t *testing.T) {
     6  	p := NewPrometheusMetricsProvider("test", "test")
     7  
     8  	c := p.NewCounter("test_c_1", "test")
     9  	c.Add(1)
    10  	c.Inc()
    11  
    12  	g := p.NewGauge("test_g_1", "test")
    13  	g.Add(1)
    14  	g.Set(1)
    15  	g.Sub(1)
    16  
    17  	h := p.NewHistogram("test_h_1", "test")
    18  	h.Observe(1)
    19  }