+ ret2["CounterBlaah1"].Inc()
+ ret2["CounterBlaah2"].Inc()
+ ret2["CounterBlaah3"].Inc()
+ ret2["CounterBlaah4"].Inc()
+
+ if len(ret1) != len(ret2) {
+ t.Errorf("ret1 len %d differs from ret2 len %d", len(ret1), len(ret2))
+ }
+}
+
+func TestMetricGauge(t *testing.T) {
+ TestGaugeOpts := CounterOpts{Name: "GaugeBlaah1", Help: "GaugeBlaah1"}
+ ret1 := Metric.RegisterGauge(TestGaugeOpts, "TestMetricGauge")
+ ret1.Inc()
+ ret2 := Metric.RegisterGauge(TestGaugeOpts, "TestMetricGauge")
+ ret2.Inc()
+ if ret1 != ret2 {
+ t.Errorf("ret1 not same than ret2. cache not working?")
+ }
+}
+
+func TestMetricGaugeGroup(t *testing.T) {
+ var TestGaugeOpts = []CounterOpts{
+ {Name: "GaugeBlaah1", Help: "GaugeBlaah1"},
+ {Name: "GaugeBlaah2", Help: "GaugeBlaah2"},
+ {Name: "GaugeBlaah3", Help: "GaugeBlaah3"},
+ {Name: "GaugeBlaah4", Help: "GaugeBlaah4"},
+ }
+
+ ret1 := Metric.RegisterGaugeGroup(TestGaugeOpts, "TestMetricGaugeGroup")
+
+ if len(ret1) == 0 {
+ t.Errorf("ret1 gauge group is empty")
+ }
+
+ ret1["GaugeBlaah1"].Inc()
+ ret1["GaugeBlaah2"].Inc()
+ ret1["GaugeBlaah3"].Inc()
+ ret1["GaugeBlaah4"].Inc()
+
+ ret2 := Metric.RegisterGaugeGroup(TestGaugeOpts, "TestMetricGaugeGroup")
+
+ if len(ret2) == 0 {
+ t.Errorf("ret2 gauge group is empty")
+ }
+
+ ret2["GaugeBlaah1"].Inc()
+ ret2["GaugeBlaah2"].Inc()
+ ret2["GaugeBlaah3"].Inc()
+ ret2["GaugeBlaah4"].Inc()
+