Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LookbackLimit ¶
type LookbackLimit interface {
// Inc increments the recent value for the limit.
Inc(new int) error
}
LookbackLimit provides an interface for a specific query limit.
type LookbackLimitOptions ¶
type LookbackLimitOptions struct {
// Limit past which errors will be returned.
Limit int64
// Lookback is the period over which the limit is enforced.
Lookback time.Duration
}
LookbackLimitOptions holds options for a lookback limit to be enforced.
func DefaultLookbackLimitOptions ¶
func DefaultLookbackLimitOptions() LookbackLimitOptions
DefaultLookbackLimitOptions returns a new query limits manager.
type QueryLimits ¶
type QueryLimits interface {
// DocsLimit limits queries by a global concurrent count of index docs matched.
DocsLimit() LookbackLimit
// BytesReadLimit limits queries by a global concurrent count of bytes read from disk.
BytesReadLimit() LookbackLimit
// AnyExceeded returns an error if any of the query limits are exceeded.
AnyExceeded() error
// Start begins background resetting of the query limits.
Start()
// Stop end background resetting of the query limits.
Stop()
}
QueryLimits provides an interface for managing query limits.
func NewQueryLimits ¶
func NewQueryLimits( docsLimitOpts LookbackLimitOptions, bytesReadLimitOpts LookbackLimitOptions, instrumentOpts instrument.Options, ) (QueryLimits, error)
NewQueryLimits returns a new query limits manager.
func NoOpQueryLimits ¶
func NoOpQueryLimits() QueryLimits
NoOpQueryLimits returns inactive query limits.
Click to show internal directories.
Click to hide internal directories.