micro-meter-victoriametrics/victoriametrics_test.go
Vasiliy Tolstov a239f86139
Some checks failed
codeql / analyze (go) (push) Failing after 50s
build / test (push) Failing after 4m53s
build / lint (push) Successful in 9m28s
update micro
Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
2024-11-08 17:38:39 +03:00

19 lines
426 B
Go

package victoriametrics
import (
"testing"
)
func TestBuildName(t *testing.T) {
m := NewMeter()
im := m.(*victoriametricsMeter)
check := `micro_foo{micro_aaa="b",micro_bar="baz",micro_ccc="d"}`
name := im.buildName("micro_foo", "micro_bar", "baz", "micro_aaa", "b", "micro_ccc", "d")
if name != check {
t.Fatalf("metric name error: %s != %s", name, check)
}
cnt := m.Counter("counter", "key", "val")
cnt.Inc()
}