Migration SQL fix

This commit is contained in:
Aditya Ujeniya
2025-09-03 08:22:15 +02:00
parent a50b832c2a
commit bca176170c
13 changed files with 172 additions and 36 deletions

View File

@@ -5,7 +5,6 @@ import (
"math"
"github.com/ClusterCockpit/cc-lib/util"
"github.com/ClusterCockpit/cc-metric-store/internal/config"
)
type Stats struct {
@@ -105,9 +104,9 @@ func (m *MemoryStore) Stats(selector util.Selector, metric string, from, to int6
return nil, 0, 0, ErrNoData
}
if minfo.Aggregation == config.AvgAggregation {
if minfo.Aggregation == AvgAggregation {
avg /= util.Float(n)
} else if n > 1 && minfo.Aggregation != config.SumAggregation {
} else if n > 1 && minfo.Aggregation != SumAggregation {
return nil, 0, 0, errors.New("invalid aggregation")
}