diff --git a/README.md b/README.md index 77953fe..aa5cb10 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ The string `%HOST%` in the metric name will automatically be replaced with the h * `HEAD`: + * Fixed behaviour of Gauge with positive numbers: the previous behaviour was the same as GaugeDelta + (FGauge already had the correct behaviour) * Added more tests * Small optimisation: replace string formatting with concatenation (thanks to @agnivade) diff --git a/event/gauge.go b/event/gauge.go index 989096e..f303536 100644 --- a/event/gauge.go +++ b/event/gauge.go @@ -35,7 +35,7 @@ func (e Gauge) Stats() []string { fmt.Sprintf("%s:%d|g", e.Name, e.Value), } } - return []string{fmt.Sprintf("%s:%+d|g", e.Name, e.Value)} + return []string{fmt.Sprintf("%s:%d|g", e.Name, e.Value)} } // Key returns the name of this metric diff --git a/event/gauge_test.go b/event/gauge_test.go index 59de71c..225ad7c 100644 --- a/event/gauge_test.go +++ b/event/gauge_test.go @@ -18,7 +18,7 @@ func TestGaugeUpdate(t *testing.T) { t.Error(err) } - expected := []string{"test:+8|g"} // only the last value is flushed + expected := []string{"test:8|g"} // only the last value is flushed actual := e1.Stats() if !reflect.DeepEqual(expected, actual) { t.Errorf("did not receive all metrics: Expected: %T %v, Actual: %T %v ", expected, expected, actual, actual)