searchutils

package
v1.57.0-cluster Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 29, 2021 License: Apache-2.0 Imports: 10 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// StorageTimeout limits the duration of query execution on every vmstorage node.
	// See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/711
	StorageTimeout = flag.Duration("search.storageTimeout", 0, "The timeout for per-storage query processing; "+
		"this allows returning partial responses if certain -storageNode instances slowly process the query; "+
		"see also -search.maxQueryDuration and -search.denyPartialResponse command-line flags")
)

Functions

func GetBool

func GetBool(r *http.Request, argKey string) bool

GetBool returns boolean value from the given argKey query arg.

func GetDenyPartialResponse

func GetDenyPartialResponse(r *http.Request) bool

GetDenyPartialResponse returns whether partial responses are denied.

func GetDuration

func GetDuration(r *http.Request, argKey string, defaultValue int64) (int64, error)

GetDuration returns duration from the given argKey query arg.

func GetEnforcedTagFiltersFromRequest added in v1.57.0

func GetEnforcedTagFiltersFromRequest(r *http.Request) ([]storage.TagFilter, error)

GetEnforcedTagFiltersFromRequest returns additional filters from request.

func GetMaxQueryDuration added in v1.41.1

func GetMaxQueryDuration(r *http.Request) time.Duration

GetMaxQueryDuration returns the maximum duration for query from r.

func GetTime

func GetTime(r *http.Request, argKey string, defaultMs int64) (int64, error)

GetTime returns time from the given argKey query arg.

If argKey is missing in r, then defaultMs rounded to seconds is returned. The rounding is needed in order to align query results in Grafana executed at different times. See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/720

Types

type Deadline

type Deadline struct {
	// contains filtered or unexported fields
}

Deadline contains deadline with the corresponding timeout for pretty error messages.

func GetDeadlineForExport

func GetDeadlineForExport(r *http.Request, startTime time.Time) Deadline

GetDeadlineForExport returns deadline for the given request to /api/v1/export.

func GetDeadlineForQuery

func GetDeadlineForQuery(r *http.Request, startTime time.Time) Deadline

GetDeadlineForQuery returns deadline for the given query r.

func NewDeadline

func NewDeadline(startTime time.Time, timeout time.Duration, flagHint string) Deadline

NewDeadline returns deadline for the given timeout.

flagHint must contain a hit for command-line flag, which could be used in order to increase timeout.

func (*Deadline) Deadline

func (d *Deadline) Deadline() uint64

Deadline returns deadline in unix timestamp seconds.

func (*Deadline) Exceeded

func (d *Deadline) Exceeded() bool

Exceeded returns true if deadline is exceeded.

func (*Deadline) String

func (d *Deadline) String() string

String returns human-readable string representation for d.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL