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
Copy file name to clipboardexpand all lines: cmd/loki-canary/main.go
+5-1
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,10 @@ func main() {
79
79
metricTestQueryRange:=flag.Duration("metric-test-range", 24*time.Hour, "The range value [24h] used in the metric test instant-query."+
80
80
" Note: this value is truncated to the running time of the canary until this value is reached")
81
81
82
+
cacheTestInterval:=flag.Duration("cache-test-interval", 15*time.Minute, "The interval the cache test query should be run")
83
+
cacheTestQueryRange:=flag.Duration("cache-test-range", 24*time.Hour, "The range value [24h] used in the cache test instant-query.")
84
+
cacheTestQueryNow:=flag.Duration("cache-test-now", 1*time.Hour, "duration how far back from current time the execution time (--now) should be set for running this query in the cache test instant-query.")
85
+
82
86
spotCheckInterval:=flag.Duration("spot-check-interval", 15*time.Minute, "Interval that a single result will be kept from sent entries and spot-checked against Loki, "+
83
87
"e.g. 15min default one entry every 15 min will be saved and then queried again every 15min until spot-check-max is reached")
84
88
spotCheckMax:=flag.Duration("spot-check-max", 4*time.Hour, "How far back to check a spot check entry before dropping it")
@@ -189,7 +193,7 @@ func main() {
189
193
_, _=fmt.Fprintf(os.Stderr, "Unable to create reader for Loki querier, check config: %s", err)
// cacheTest is currently run using `reader.CountOverTime()` which is an instant query.
348
+
// We make the query with and without cache over the data that is not changing (e.g: --now="1hr ago") instead of on latest data that is a moving target.
349
+
queryStartTime:=currTime.Add(-c.cacheTestNow)
350
+
351
+
// We cannot query for range before the pod even started.
352
+
ifqueryStartTime.Before(c.startTime) {
353
+
// we wait.
354
+
fmt.Fprintf(c.w, "cacheTest not run. still waiting for query start range(%s) to past the process start time(%s).\n", queryStartTime, c.startTime)
0 commit comments