You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
f.IntVar(&cfg.Eviction.CooldownPeriod, prefix+"query-protection.eviction.cooldown-period", 3, "EXPERIMENTAL: Number of check intervals to wait after an eviction before evicting again.")
61
62
f.StringVar(&cfg.Eviction.EvictionMetric, prefix+"query-protection.eviction.eviction-metric", "fetched_samples", "EXPERIMENTAL: The query metric used to determine the heaviest query for eviction. Supported values: fetched_samples, fetched_series, fetched_chunks, fetched_chunk_bytes.")
62
63
f.DurationVar(&cfg.Eviction.MinQueryAge, prefix+"query-protection.eviction.min-query-age", 10*time.Second, "EXPERIMENTAL: Minimum time a query must be running before it becomes eligible for eviction. Queries younger than this are ignored.")
64
+
f.IntVar(&cfg.Eviction.MaxEvictionsPerCycle, prefix+"query-protection.eviction.max-evictions-per-cycle", 1, "EXPERIMENTAL: Maximum number of queries to evict in a single check cycle when resource thresholds are breached.")
"cpu > 1 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.CPUUtilization=1.5 }, []string{"cpu", "heap"}, "eviction cpu_utilization must be between 0 and 1"},
117
-
"cpu < 0 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.CPUUtilization=-0.1 }, []string{"cpu", "heap"}, "eviction cpu_utilization must be between 0 and 1"},
118
-
"heap > 1 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.HeapUtilization=2.0 }, []string{"cpu", "heap"}, "eviction heap_utilization must be between 0 and 1"},
119
-
"heap < 0 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.HeapUtilization=-0.5 }, []string{"cpu", "heap"}, "eviction heap_utilization must be between 0 and 1"},
120
-
"check_interval 0 fails": {func(qp*QueryProtection) { qp.Eviction.CheckInterval=0 }, []string{"cpu", "heap"}, "eviction check_interval must be greater than 0 when eviction is enabled"},
121
-
"cooldown < 0 fails": {func(qp*QueryProtection) { qp.Eviction.CooldownPeriod=-1 }, []string{"cpu", "heap"}, "eviction cooldown_period must be >= 0"},
"cpu without monitored fails": {func(qp*QueryProtection) {}, []string{"heap"}, `monitored_resources config must include "cpu" when eviction cpu threshold is set`},
124
-
"heap without monitored fails": {func(qp*QueryProtection) {}, []string{"cpu"}, `monitored_resources config must include "heap" when eviction heap threshold is set`},
"cpu > 1 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.CPUUtilization=1.5 }, []string{"cpu", "heap"}, "eviction cpu_utilization must be between 0 and 1"},
118
+
"cpu < 0 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.CPUUtilization=-0.1 }, []string{"cpu", "heap"}, "eviction cpu_utilization must be between 0 and 1"},
119
+
"heap > 1 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.HeapUtilization=2.0 }, []string{"cpu", "heap"}, "eviction heap_utilization must be between 0 and 1"},
120
+
"heap < 0 fails": {func(qp*QueryProtection) { qp.Eviction.Threshold.HeapUtilization=-0.5 }, []string{"cpu", "heap"}, "eviction heap_utilization must be between 0 and 1"},
121
+
"check_interval 0 fails": {func(qp*QueryProtection) { qp.Eviction.CheckInterval=0 }, []string{"cpu", "heap"}, "eviction check_interval must be greater than 0 when eviction is enabled"},
122
+
"cooldown < 0 fails": {func(qp*QueryProtection) { qp.Eviction.CooldownPeriod=-1 }, []string{"cpu", "heap"}, "eviction cooldown_period must be >= 0"},
"cpu without monitored fails": {func(qp*QueryProtection) {}, []string{"heap"}, `monitored_resources config must include "cpu" when eviction cpu threshold is set`},
125
+
"heap without monitored fails": {func(qp*QueryProtection) {}, []string{"cpu"}, `monitored_resources config must include "heap" when eviction heap threshold is set`},
0 commit comments