From 89c93185d4a919fa5528daedc00e312247e7754d Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Thu, 17 Aug 2023 11:24:06 +0200 Subject: [PATCH] Add missing case for type []int32 --- internal/metricAggregator/metricAggregatorFunctions.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/internal/metricAggregator/metricAggregatorFunctions.go b/internal/metricAggregator/metricAggregatorFunctions.go index 37ed5d9..26b2108 100644 --- a/internal/metricAggregator/metricAggregatorFunctions.go +++ b/internal/metricAggregator/metricAggregatorFunctions.go @@ -123,6 +123,13 @@ func avgfunc(args interface{}) (interface{}, error) { s += x } return s / int64(len(values)), nil + case []int32: + var s int32 = 0 + for _, x := range values { + s += x + } + return s / int32(len(values)), nil + } return 0.0, nil }