@@ -7,11 +7,15 @@ import (
77 "go.opentelemetry.io/collector/pdata/pcommon"
88
99 ty "github.com/kedify/otel-add-on/types"
10+ "github.com/kedify/otel-add-on/util"
1011)
1112
1213func TestLazyMemStorePutOneAndGetNothing (t * testing.T ) {
1314 // setup
14- ms := NewMetricStore (5 , true , false )
15+ ms := NewMetricStore (& util.Config {
16+ MetricStoreRetentionSeconds : 5 ,
17+ MetricStoreLazySeries : true ,
18+ })
1519 ms .Put (ty.NewMetricEntry {
1620 Name : "metric1" ,
1721 MeasurementTime : pcommon .Timestamp (time .Now ().Unix ()),
@@ -28,7 +32,10 @@ func TestLazyMemStorePutOneAndGetNothing(t *testing.T) {
2832
2933func TestLazyMemStoreGetPutAndGet (t * testing.T ) {
3034 // setup
31- ms := NewMetricStore (70 , true , false )
35+ ms := NewMetricStore (& util.Config {
36+ MetricStoreRetentionSeconds : 70 ,
37+ MetricStoreLazySeries : true ,
38+ })
3239 labels := map [string ]any {
3340 "a" : "1" ,
3441 }
@@ -48,7 +55,10 @@ func TestLazyMemStoreGetPutAndGet(t *testing.T) {
4855
4956func TestMemStoreLazyAggregatesFirstCallNotFound (t * testing.T ) {
5057 // setup
51- ms := NewMetricStore (5 , false , true )
58+ ms := NewMetricStore (& util.Config {
59+ MetricStoreRetentionSeconds : 5 ,
60+ MetricStoreLazyAggregates : true ,
61+ })
5262 ms .Put (ty.NewMetricEntry {
5363 Name : "metric1" ,
5464 MeasurementTime : pcommon .Timestamp (time .Now ().Unix ()),
@@ -65,7 +75,10 @@ func TestMemStoreLazyAggregatesFirstCallNotFound(t *testing.T) {
6575
6676func TestMemStoreLazyAggregatesOneAgg (t * testing.T ) {
6777 // setup
68- ms := NewMetricStore (70 , false , true )
78+ ms := NewMetricStore (& util.Config {
79+ MetricStoreRetentionSeconds : 70 ,
80+ MetricStoreLazyAggregates : true ,
81+ })
6982 labels := map [string ]any {
7083 "a" : "1" ,
7184 }
@@ -82,7 +95,10 @@ func TestMemStoreLazyAggregatesOneAgg(t *testing.T) {
8295
8396func TestMemStoreLazyAggregatesAddingOnTheFly (t * testing.T ) {
8497 // setup
85- ms := NewMetricStore (70 , false , true )
98+ ms := NewMetricStore (& util.Config {
99+ MetricStoreRetentionSeconds : 70 ,
100+ MetricStoreLazyAggregates : true ,
101+ })
86102 labels := map [string ]any {
87103 "a" : "1" ,
88104 }
@@ -103,7 +119,11 @@ func TestMemStoreLazyAggregatesAddingOnTheFly(t *testing.T) {
103119
104120func TestLazyMemStoreAndLazyAggregatesComplex (t * testing.T ) {
105121 // setup
106- ms := NewMetricStore (700 , true , true )
122+ ms := NewMetricStore (& util.Config {
123+ MetricStoreRetentionSeconds : 700 ,
124+ MetricStoreLazySeries : true ,
125+ MetricStoreLazyAggregates : true ,
126+ })
107127 labels := map [string ]any {
108128 "a" : "1" ,
109129 "b" : "2" ,
0 commit comments