Permalink
Browse files
registry: add a basic test to detect v2 metrics
- Loading branch information...
Showing
with
16 additions
and
0 deletions.
-
+16
−0
registry_test.go
|
|
@@ -128,3 +128,19 @@ func TestStringInstanceConstruction(t *testing.T) { |
|
|
t.Errorf("Expected Value Count to be 3, got %v", r.ValuesCount())
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+func TestMMVV2MetricRegistration(t *testing.T) {
|
|
|
+ r := NewPCPRegistry()
|
|
|
+
|
|
|
+ m, err := NewPCPSingletonMetric(10, "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz", Int32Type, CounterSemantics, OneUnit)
|
|
|
+ if err != nil {
|
|
|
+ t.Errorf("cannot create metric, error: %v", err)
|
|
|
+ return
|
|
|
+ }
|
|
|
+
|
|
|
+ r.AddMetric(m)
|
|
|
+
|
|
|
+ if r.stringcount != 1 {
|
|
|
+ t.Errorf("expected the metric name to be registered in the strings section")
|
|
|
+ }
|
|
|
+}
|
0 comments on commit
4a78504