mirror of
https://github.com/ferdzo/fs.git
synced 2026-04-05 09:36:25 +00:00
Auth for metrics, removed unwanted metrics and fixed tests.
This commit is contained in:
26
metrics/metrics_test.go
Normal file
26
metrics/metrics_test.go
Normal file
@@ -0,0 +1,26 @@
|
||||
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")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user