Documentation ¶
Index ¶
- func AdjustStartEnd(start, end, step int64) (int64, int64)
- func DurationValue(s string, step int64) (int64, error)
- func Exec(ec *EvalConfig, q string, isFirstPointOnly bool) ([]netstorage.Result, error)
- func ExpandWithExprs(q string) (string, error)
- func InitRollupResultCache(cachePath string)
- func IsMetricSelectorWithRollup(s string) (childQuery string, window, offset string)
- func ParseMetricSelector(s string) ([]storage.TagFilter, error)
- func ResetRollupResultCache()
- func StopRollupResultCache()
- func ValidateMaxPointsPerTimeseries(start, end, step int64) error
- type EvalConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AdjustStartEnd ¶
AdjustStartEnd adjusts start and end values, so response caching may be enabled.
See EvalConfig.mayCache for details.
func DurationValue ¶
DurationValue returns the duration in milliseconds for the given s and the given step.
func Exec ¶
func Exec(ec *EvalConfig, q string, isFirstPointOnly bool) ([]netstorage.Result, error)
Exec executes q for the given ec.
func ExpandWithExprs ¶
ExpandWithExprs expands WITH expressions inside q and returns the resulting PromQL without WITH expressions.
func InitRollupResultCache ¶
func InitRollupResultCache(cachePath string)
InitRollupResultCache initializes the rollupResult cache
func IsMetricSelectorWithRollup ¶
IsMetricSelectorWithRollup verifies whether s contains PromQL metric selector wrapped into rollup.
It returns the wrapped query with the corresponding window with offset.
func ParseMetricSelector ¶
ParseMetricSelector parses s containing PromQL metric selector and returns the corresponding TagFilters.
func ResetRollupResultCache ¶
func ResetRollupResultCache()
ResetRollupResultCache resets rollup result cache.
func StopRollupResultCache ¶
func StopRollupResultCache()
StopRollupResultCache closes the rollupResult cache.
func ValidateMaxPointsPerTimeseries ¶
ValidateMaxPointsPerTimeseries checks the maximum number of points that may be returned per each time series.
The number mustn't exceed -search.maxPointsPerTimeseries.
Types ¶
type EvalConfig ¶
type EvalConfig struct { Start int64 End int64 Step int64 Deadline netstorage.Deadline MayCache bool // LookbackDelta is analog to `-query.lookback-delta` from Prometheus. LookbackDelta int64 // contains filtered or unexported fields }
EvalConfig is the configuration required for query evaluation via Exec