-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add config flags for Cortex fifo cache
Signed-off-by: Ben Ye <yb532204897@gmail.com>
- Loading branch information
Showing
5 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright (c) The Thanos Authors. | ||
// Licensed under the Apache License 2.0. | ||
|
||
package queryfrontend | ||
|
||
import ( | ||
"time" | ||
|
||
cortexcache "github.com/cortexproject/cortex/pkg/chunk/cache" | ||
"github.com/cortexproject/cortex/pkg/querier/queryrange" | ||
) | ||
|
||
// NewFifoCacheConfig creates Cortex fifo cache config. | ||
func NewFifoCacheConfig(maxSizeBytes string, maxSizeItems int, ttl time.Duration) queryrange.ResultsCacheConfig { | ||
return queryrange.ResultsCacheConfig{ | ||
CacheConfig: cortexcache.Config{ | ||
EnableFifoCache: true, | ||
Fifocache: cortexcache.FifoCacheConfig{ | ||
MaxSizeBytes: maxSizeBytes, | ||
MaxSizeItems: maxSizeItems, | ||
Validity: ttl, | ||
}, | ||
}, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters