micro/metrics/options_test.go
Prawn f9f61d29de
Observability/metrics update (#1962)
* Removing logging from the NOOP implementatino

* Simplifying the percentiles option

* Simple logging implementation

Co-authored-by: chris <chris@Profanity.local>
2020-08-21 20:57:10 +12:00

25 lines
602 B
Go

package metrics
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestOptions(t *testing.T) {
// Make some new options:
options := NewOptions(
Address(":9999"),
DefaultTags(map[string]string{"service": "prometheus-test"}),
Path("/prometheus"),
Percentiles([]float64{0.11, 0.22, 0.33}),
)
// Check that the defaults and overrides were accepted:
assert.Equal(t, ":9999", options.Address)
assert.Equal(t, "prometheus-test", options.DefaultTags["service"])
assert.Equal(t, "/prometheus", options.Path)
assert.Equal(t, []float64{0.11, 0.22, 0.33}, options.Percentiles)
}