From e599780fadbb5d5e99dd20696cc2b6e217e0c2a1 Mon Sep 17 00:00:00 2001 From: Alex Boten <223565+codeboten@users.noreply.github.com> Date: Mon, 6 May 2024 14:37:27 -0700 Subject: [PATCH] [chore] add unit test for histogram in mdatagen (#10089) Signed-off-by: Alex Boten <223565+codeboten@users.noreply.github.com> --- cmd/mdatagen/metricdata.go | 4 ++-- cmd/mdatagen/metricdata_test.go | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/mdatagen/metricdata.go b/cmd/mdatagen/metricdata.go index aa80904e607..c011be6db7a 100644 --- a/cmd/mdatagen/metricdata.go +++ b/cmd/mdatagen/metricdata.go @@ -209,11 +209,11 @@ func (d histogram) Type() string { } func (d histogram) HasMonotonic() bool { - return true + return false } func (d histogram) HasAggregated() bool { - return true + return false } func (d histogram) Instrument() string { diff --git a/cmd/mdatagen/metricdata_test.go b/cmd/mdatagen/metricdata_test.go index 10b7f46613e..fc67af4e074 100644 --- a/cmd/mdatagen/metricdata_test.go +++ b/cmd/mdatagen/metricdata_test.go @@ -18,6 +18,7 @@ func TestMetricData(t *testing.T) { }{ {&gauge{}, "Gauge", false, false}, {&sum{}, "Sum", true, true}, + {&histogram{}, "Histogram", false, false}, } { assert.Equal(t, arg.typ, arg.metricData.Type()) assert.Equal(t, arg.hasAggregated, arg.metricData.HasAggregated())