-
Notifications
You must be signed in to change notification settings - Fork 781
/
limits.go
31 lines (23 loc) · 1.07 KB
/
limits.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package tripperware
import (
"time"
"github.com/cortexproject/cortex/pkg/util/validation"
)
// Limits allows us to specify per-tenant runtime limits on the behavior of
// the query handling code.
type Limits interface {
// MaxQueryLookback returns the max lookback period of queries.
MaxQueryLookback(userID string) time.Duration
// MaxQueryLength returns the limit of the length (in time) of a query.
MaxQueryLength(string) time.Duration
// MaxQueryParallelism returns the limit to the number of split queries the
// frontend will process in parallel.
MaxQueryParallelism(string) int
// MaxCacheFreshness returns the period after which results are cacheable,
// to prevent caching of very recent results.
MaxCacheFreshness(string) time.Duration
// QueryVerticalShardSize returns the maximum number of queriers that can handle requests for this user.
QueryVerticalShardSize(userID string) int
// QueryPriority returns the query priority config for the tenant, including different priorities and their attributes.
QueryPriority(userID string) validation.QueryPriority
}