@@ -13,9 +13,9 @@ import (
1313func Test_Cache_LRUEviction (t * testing.T ) {
1414 reg := prometheus .NewRegistry ()
1515 cfg := & CacheConfig {
16- ParquetQueryableShardCacheSize : 2 ,
17- ParquetQueryableShardCacheTTL : 0 ,
18- MaintenanceInterval : time .Minute ,
16+ ParquetShardCacheSize : 2 ,
17+ ParquetShardCacheTTL : 0 ,
18+ MaintenanceInterval : time .Minute ,
1919 }
2020 cache , err := NewCache [string ](cfg , "test" , reg )
2121 require .NoError (t , err )
@@ -36,27 +36,27 @@ func Test_Cache_LRUEviction(t *testing.T) {
3636 require .Equal (t , "" , val2 )
3737
3838 require .NoError (t , testutil .GatherAndCompare (reg , bytes .NewBufferString (`
39- # HELP cortex_parquet_queryable_cache_evictions_total Total number of parquet cache evictions
40- # TYPE cortex_parquet_queryable_cache_evictions_total counter
41- cortex_parquet_queryable_cache_evictions_total {name="test"} 1
42- # HELP cortex_parquet_queryable_cache_hits_total Total number of parquet cache hits
43- # TYPE cortex_parquet_queryable_cache_hits_total counter
44- cortex_parquet_queryable_cache_hits_total {name="test"} 3
45- # HELP cortex_parquet_queryable_cache_item_count Current number of cached parquet items
46- # TYPE cortex_parquet_queryable_cache_item_count gauge
47- cortex_parquet_queryable_cache_item_count {name="test"} 2
48- # HELP cortex_parquet_queryable_cache_misses_total Total number of parquet cache misses
49- # TYPE cortex_parquet_queryable_cache_misses_total counter
50- cortex_parquet_queryable_cache_misses_total {name="test"} 1
39+ # HELP cortex_parquet_cache_evictions_total Total number of parquet cache evictions
40+ # TYPE cortex_parquet_cache_evictions_total counter
41+ cortex_parquet_cache_evictions_total {name="test"} 1
42+ # HELP cortex_parquet_cache_hits_total Total number of parquet cache hits
43+ # TYPE cortex_parquet_cache_hits_total counter
44+ cortex_parquet_cache_hits_total {name="test"} 3
45+ # HELP cortex_parquet_cache_item_count Current number of cached parquet items
46+ # TYPE cortex_parquet_cache_item_count gauge
47+ cortex_parquet_cache_item_count {name="test"} 2
48+ # HELP cortex_parquet_cache_misses_total Total number of parquet cache misses
49+ # TYPE cortex_parquet_cache_misses_total counter
50+ cortex_parquet_cache_misses_total {name="test"} 1
5151 ` )))
5252}
5353
5454func Test_Cache_TTLEvictionByGet (t * testing.T ) {
5555 reg := prometheus .NewRegistry ()
5656 cfg := & CacheConfig {
57- ParquetQueryableShardCacheSize : 10 ,
58- ParquetQueryableShardCacheTTL : 100 * time .Millisecond ,
59- MaintenanceInterval : time .Minute ,
57+ ParquetShardCacheSize : 10 ,
58+ ParquetShardCacheTTL : 100 * time .Millisecond ,
59+ MaintenanceInterval : time .Minute ,
6060 }
6161
6262 cache , err := NewCache [string ](cfg , "test" , reg )
@@ -75,27 +75,27 @@ func Test_Cache_TTLEvictionByGet(t *testing.T) {
7575 require .Equal (t , "" , val )
7676
7777 require .NoError (t , testutil .GatherAndCompare (reg , bytes .NewBufferString (`
78- # HELP cortex_parquet_queryable_cache_evictions_total Total number of parquet cache evictions
79- # TYPE cortex_parquet_queryable_cache_evictions_total counter
80- cortex_parquet_queryable_cache_evictions_total {name="test"} 1
81- # HELP cortex_parquet_queryable_cache_hits_total Total number of parquet cache hits
82- # TYPE cortex_parquet_queryable_cache_hits_total counter
83- cortex_parquet_queryable_cache_hits_total {name="test"} 1
84- # HELP cortex_parquet_queryable_cache_item_count Current number of cached parquet items
85- # TYPE cortex_parquet_queryable_cache_item_count gauge
86- cortex_parquet_queryable_cache_item_count {name="test"} 0
87- # HELP cortex_parquet_queryable_cache_misses_total Total number of parquet cache misses
88- # TYPE cortex_parquet_queryable_cache_misses_total counter
89- cortex_parquet_queryable_cache_misses_total {name="test"} 1
78+ # HELP cortex_parquet_cache_evictions_total Total number of parquet cache evictions
79+ # TYPE cortex_parquet_cache_evictions_total counter
80+ cortex_parquet_cache_evictions_total {name="test"} 1
81+ # HELP cortex_parquet_cache_hits_total Total number of parquet cache hits
82+ # TYPE cortex_parquet_cache_hits_total counter
83+ cortex_parquet_cache_hits_total {name="test"} 1
84+ # HELP cortex_parquet_cache_item_count Current number of cached parquet items
85+ # TYPE cortex_parquet_cache_item_count gauge
86+ cortex_parquet_cache_item_count {name="test"} 0
87+ # HELP cortex_parquet_cache_misses_total Total number of parquet cache misses
88+ # TYPE cortex_parquet_cache_misses_total counter
89+ cortex_parquet_cache_misses_total {name="test"} 1
9090 ` )))
9191}
9292
9393func Test_Cache_TTLEvictionByLoop (t * testing.T ) {
9494 reg := prometheus .NewRegistry ()
9595 cfg := & CacheConfig {
96- ParquetQueryableShardCacheSize : 10 ,
97- ParquetQueryableShardCacheTTL : 100 * time .Millisecond ,
98- MaintenanceInterval : 100 * time .Millisecond ,
96+ ParquetShardCacheSize : 10 ,
97+ ParquetShardCacheTTL : 100 * time .Millisecond ,
98+ MaintenanceInterval : 100 * time .Millisecond ,
9999 }
100100
101101 cache , err := NewCache [string ](cfg , "test" , reg )
@@ -117,14 +117,14 @@ func Test_Cache_TTLEvictionByLoop(t *testing.T) {
117117 }
118118
119119 require .NoError (t , testutil .GatherAndCompare (reg , bytes .NewBufferString (`
120- # HELP cortex_parquet_queryable_cache_evictions_total Total number of parquet cache evictions
121- # TYPE cortex_parquet_queryable_cache_evictions_total counter
122- cortex_parquet_queryable_cache_evictions_total {name="test"} 1
123- # HELP cortex_parquet_queryable_cache_hits_total Total number of parquet cache hits
124- # TYPE cortex_parquet_queryable_cache_hits_total counter
125- cortex_parquet_queryable_cache_hits_total {name="test"} 1
126- # HELP cortex_parquet_queryable_cache_item_count Current number of cached parquet items
127- # TYPE cortex_parquet_queryable_cache_item_count gauge
128- cortex_parquet_queryable_cache_item_count {name="test"} 0
120+ # HELP cortex_parquet_cache_evictions_total Total number of parquet cache evictions
121+ # TYPE cortex_parquet_cache_evictions_total counter
122+ cortex_parquet_cache_evictions_total {name="test"} 1
123+ # HELP cortex_parquet_cache_hits_total Total number of parquet cache hits
124+ # TYPE cortex_parquet_cache_hits_total counter
125+ cortex_parquet_cache_hits_total {name="test"} 1
126+ # HELP cortex_parquet_cache_item_count Current number of cached parquet items
127+ # TYPE cortex_parquet_cache_item_count gauge
128+ cortex_parquet_cache_item_count {name="test"} 0
129129 ` )))
130130}
0 commit comments