mirror of
https://github.com/ferdzo/fs.git
synced 2026-04-04 20:36:25 +00:00
27 lines
735 B
Go
27 lines
735 B
Go
package metrics
|
|
|
|
import (
|
|
"strings"
|
|
"testing"
|
|
)
|
|
|
|
func TestRenderPrometheusHistogramNoEmptyLabelSet(t *testing.T) {
|
|
reg := NewRegistry()
|
|
reg.ObserveBatchSize(3)
|
|
reg.ObserveGC(0, 0, 0, 0, true)
|
|
|
|
out := reg.RenderPrometheus()
|
|
if strings.Contains(out, "fs_batch_size_histogram_sum{}") {
|
|
t.Fatalf("unexpected empty label set for batch sum metric")
|
|
}
|
|
if strings.Contains(out, "fs_batch_size_histogram_count{}") {
|
|
t.Fatalf("unexpected empty label set for batch count metric")
|
|
}
|
|
if strings.Contains(out, "fs_gc_duration_seconds_sum{}") {
|
|
t.Fatalf("unexpected empty label set for gc sum metric")
|
|
}
|
|
if strings.Contains(out, "fs_gc_duration_seconds_count{}") {
|
|
t.Fatalf("unexpected empty label set for gc count metric")
|
|
}
|
|
}
|