File tree Expand file tree Collapse file tree 5 files changed +19
-30
lines changed Expand file tree Collapse file tree 5 files changed +19
-30
lines changed Original file line number Diff line number Diff line change @@ -1550,6 +1550,10 @@ blocks_storage:
1550
1550
# compacted blocks.
1551
1551
expanded_postings_cache :
1552
1552
head :
1553
+ # Whether the postings cache is enabled or not
1554
+ # CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
1555
+ [enabled : <boolean> | default = false]
1556
+
1553
1557
# Max bytes for postings cache
1554
1558
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
1555
1559
[max_bytes : <int> | default = 10485760]
@@ -1558,20 +1562,16 @@ blocks_storage:
1558
1562
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
1559
1563
[ttl : <duration> | default = 10m]
1560
1564
1565
+ blocks :
1561
1566
# Whether the postings cache is enabled or not
1562
- # CLI flag: -blocks-storage.expanded_postings_cache.head .enabled
1567
+ # CLI flag: -blocks-storage.expanded_postings_cache.block .enabled
1563
1568
[enabled : <boolean> | default = false]
1564
1569
1565
- blocks :
1566
1570
# Max bytes for postings cache
1567
1571
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
1568
1572
[max_bytes : <int> | default = 10485760]
1569
1573
1570
1574
# TTL for postings cache
1571
1575
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
1572
1576
[ttl : <duration> | default = 10m]
1573
-
1574
- # Whether the postings cache is enabled or not
1575
- # CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
1576
- [enabled : <boolean> | default = false]
1577
1577
` ` `
Original file line number Diff line number Diff line change @@ -1641,6 +1641,10 @@ blocks_storage:
1641
1641
# compacted blocks.
1642
1642
expanded_postings_cache :
1643
1643
head :
1644
+ # Whether the postings cache is enabled or not
1645
+ # CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
1646
+ [enabled : <boolean> | default = false]
1647
+
1644
1648
# Max bytes for postings cache
1645
1649
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
1646
1650
[max_bytes : <int> | default = 10485760]
@@ -1649,20 +1653,16 @@ blocks_storage:
1649
1653
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
1650
1654
[ttl : <duration> | default = 10m]
1651
1655
1656
+ blocks :
1652
1657
# Whether the postings cache is enabled or not
1653
- # CLI flag: -blocks-storage.expanded_postings_cache.head .enabled
1658
+ # CLI flag: -blocks-storage.expanded_postings_cache.block .enabled
1654
1659
[enabled : <boolean> | default = false]
1655
1660
1656
- blocks :
1657
1661
# Max bytes for postings cache
1658
1662
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
1659
1663
[max_bytes : <int> | default = 10485760]
1660
1664
1661
1665
# TTL for postings cache
1662
1666
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
1663
1667
[ttl : <duration> | default = 10m]
1664
-
1665
- # Whether the postings cache is enabled or not
1666
- # CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
1667
- [enabled : <boolean> | default = false]
1668
1668
` ` `
Original file line number Diff line number Diff line change @@ -2087,6 +2087,10 @@ tsdb:
2087
2087
# compacted blocks.
2088
2088
expanded_postings_cache :
2089
2089
head :
2090
+ # Whether the postings cache is enabled or not
2091
+ # CLI flag: -blocks-storage.expanded_postings_cache.head.enabled
2092
+ [enabled : <boolean> | default = false]
2093
+
2090
2094
# Max bytes for postings cache
2091
2095
# CLI flag: -blocks-storage.expanded_postings_cache.head.max-bytes
2092
2096
[max_bytes : <int> | default = 10485760]
@@ -2095,22 +2099,18 @@ tsdb:
2095
2099
# CLI flag: -blocks-storage.expanded_postings_cache.head.ttl
2096
2100
[ttl : <duration> | default = 10m]
2097
2101
2102
+ blocks :
2098
2103
# Whether the postings cache is enabled or not
2099
- # CLI flag: -blocks-storage.expanded_postings_cache.head .enabled
2104
+ # CLI flag: -blocks-storage.expanded_postings_cache.block .enabled
2100
2105
[enabled : <boolean> | default = false]
2101
2106
2102
- blocks :
2103
2107
# Max bytes for postings cache
2104
2108
# CLI flag: -blocks-storage.expanded_postings_cache.block.max-bytes
2105
2109
[max_bytes : <int> | default = 10485760]
2106
2110
2107
2111
# TTL for postings cache
2108
2112
# CLI flag: -blocks-storage.expanded_postings_cache.block.ttl
2109
2113
[ttl : <duration> | default = 10m]
2110
-
2111
- # Whether the postings cache is enabled or not
2112
- # CLI flag: -blocks-storage.expanded_postings_cache.block.enabled
2113
- [enabled : <boolean> | default = false]
2114
2114
` ` `
2115
2115
2116
2116
### ` compactor_config`
Original file line number Diff line number Diff line change @@ -67,9 +67,9 @@ type TSDBPostingsCacheConfig struct {
67
67
}
68
68
69
69
type PostingsCacheConfig struct {
70
+ Enabled bool `yaml:"enabled"`
70
71
MaxBytes int64 `yaml:"max_bytes"`
71
72
Ttl time.Duration `yaml:"ttl"`
72
- Enabled bool `yaml:"enabled"`
73
73
}
74
74
75
75
func (cfg * TSDBPostingsCacheConfig ) RegisterFlagsWithPrefix (prefix string , f * flag.FlagSet ) {
Original file line number Diff line number Diff line change @@ -37,19 +37,9 @@ func TestFifoCacheExpire(t *testing.T) {
37
37
expectedFinalItems int
38
38
ttlExpire bool
39
39
}{
40
- "MaxItems" : {
41
- expectedFinalItems : 3 ,
42
- cfg : PostingsCacheConfig {
43
- MaxItems : 3 ,
44
- Enabled : true ,
45
- Ttl : time .Hour ,
46
- MaxBytes : 10 << 20 ,
47
- },
48
- },
49
40
"MaxBytes" : {
50
41
expectedFinalItems : 10 ,
51
42
cfg : PostingsCacheConfig {
52
- MaxItems : 10 << 20 ,
53
43
Enabled : true ,
54
44
Ttl : time .Hour ,
55
45
MaxBytes : int64 (10 * (8 + keySize )),
@@ -59,7 +49,6 @@ func TestFifoCacheExpire(t *testing.T) {
59
49
expectedFinalItems : numberOfKeys ,
60
50
ttlExpire : true ,
61
51
cfg : PostingsCacheConfig {
62
- MaxItems : 10 << 20 ,
63
52
Enabled : true ,
64
53
Ttl : time .Hour ,
65
54
MaxBytes : 10 << 20 ,
You can’t perform that action at this time.
0 commit comments