engine

package
v0.0.0-...-3e34b56 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(opts Opts) *compatibilityEngine

func NewDistributedEngine

func NewDistributedEngine(opts Opts, endpoints api.RemoteEndpoints) v1.QueryEngine

func NewRemoteEngine

func NewRemoteEngine(opts Opts, q storage.Queryable, mint, maxt int64, labelSets []labels.Labels) *remoteEngine

Types

type ExplainOutputNode

type ExplainOutputNode struct {
	OperatorName string              `json:"name,omitempty"`
	Children     []ExplainOutputNode `json:"children,omitempty"`
}

type ExplainableQuery

type ExplainableQuery interface {
	promql.Query

	Explain() *ExplainOutputNode
	Profile()
}

type Opts

type Opts struct {
	promql.EngineOpts

	// LogicalOptimizers are optimizers that are run if the value is not nil. If it is nil then the default optimizers are run. Default optimizer list is available in the logicalplan package.
	LogicalOptimizers []logicalplan.Optimizer

	// DisableFallback enables mode where engine returns error if some expression of feature is not yet implemented
	// in the new engine, instead of falling back to prometheus engine.
	DisableFallback bool

	// DebugWriter specifies output for debug (multi-line) information meant for humans debugging the engine.
	// If nil, nothing will be printed.
	// NOTE: Users will not check the errors, debug writing is best effort.
	DebugWriter io.Writer

	// ExtLookbackDelta specifies what time range to use to determine valid previous sample for extended range functions.
	// Defaults to 1 hour if not specified.
	ExtLookbackDelta time.Duration

	// EnableXFunctions enables custom xRate, xIncrease and xDelta functions.
	// This will default to false.
	EnableXFunctions bool

	// FallbackEngine
	Engine v1.QueryEngine
}

type Query

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

func (*Query) Explain

func (q *Query) Explain() *ExplainOutputNode

Explain returns human-readable explanation of the created executor.

func (*Query) Profile

func (q *Query) Profile()

type QueryType

type QueryType int
const (
	InstantQuery QueryType = 1
	RangeQuery   QueryType = 2
)

Jump to

Keyboard shortcuts

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