internal

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CollectionRequest

type CollectionRequest struct {
	Timestamp        schema.ComparisonValue
	Start            schema.ComparisonValue
	End              schema.ComparisonValue
	OrderBy          []ColumnOrder
	Value            *schema.ExpressionBinaryComparisonOperator
	LabelExpressions map[string]*LabelExpression
	Functions        []KeyValue
}

CollectionRequest the structured predicate result which is evaluated from the raw expression

func EvalCollectionRequest

func EvalCollectionRequest(request *schema.QueryRequest, arguments map[string]any) (*CollectionRequest, error)

EvalCollectionRequest evaluates the requested collection data of the query request

type ColumnOrder

type ColumnOrder struct {
	Name       string
	Descending bool
}

ColumnOrder the structured sorting columns

type HoltWintersInput

type HoltWintersInput struct {
	Sf    float64
	Tf    float64
	Range client.RangeResolution
}

HoltWintersInput represents input arguments of the holt_winters function

func (*HoltWintersInput) FromValue

func (hwi *HoltWintersInput) FromValue(value any, unixTimeUnit client.UnixTimeUnit) error

FromValue decodes data from any value

type KeyValue

type KeyValue struct {
	Key   string
	Value any
}

KeyValue represents a key-value pair

type LabelExpression

type LabelExpression struct {
	Name        string
	Expressions []schema.ExpressionBinaryComparisonOperator
}

LabelExpression the structured data of a label expression

type LabelExpressionBuilder

type LabelExpressionBuilder struct {
	LabelExpression
	// contains filtered or unexported fields
}

func (*LabelExpressionBuilder) Evaluate

func (le *LabelExpressionBuilder) Evaluate(variables map[string]any) (string, bool, error)

Evaluate evaluates the list of expressions and returns the query string

type LabelExpressionField

type LabelExpressionField struct {
	Value   string
	IsRegex bool
}

LabelExpressionField the structured data of a label field expression

type LabelJoinInput

type LabelJoinInput struct {
	DestLabel    string   `mapstructure:"dest_label"`
	Separator    string   `mapstructure:"separator"`
	SourceLabels []string `mapstructure:"source_labels"`
}

LabelJoinInput represents input arguments for the replace_label function

func (LabelJoinInput) String

func (lji LabelJoinInput) String() string

String implements the fmt.Stringer interface

type LabelReplaceInput

type LabelReplaceInput struct {
	DestLabel   string `mapstructure:"dest_label"`
	Replacement string `mapstructure:"replacement"`
	SourceLabel string `mapstructure:"source_label"`
	Regex       string `mapstructure:"regex"`
}

LabelReplaceInput represents input arguments for the replace_label function

func (LabelReplaceInput) String

func (lri LabelReplaceInput) String() string

String implements the fmt.Stringer interface

type NativeQueryExecutor

type NativeQueryExecutor struct {
	Client      *client.Client
	Tracer      trace.Tracer
	Runtime     *metadata.RuntimeSettings
	Request     *schema.QueryRequest
	NativeQuery *metadata.NativeQuery
	Arguments   map[string]any
	Variables   map[string]any
}

func (*NativeQueryExecutor) Execute

func (nqe *NativeQueryExecutor) Execute(ctx context.Context) (*schema.RowSet, error)

Execute executes the query request

func (*NativeQueryExecutor) Explain

Explain explains the query request

type NativeQueryRequest added in v0.3.0

type NativeQueryRequest struct {
	Timestamp       any
	Start           any
	End             any
	Timeout         any
	Step            any
	OrderBy         []ColumnOrder
	Variables       map[string]any
	Expression      schema.Expression
	HasValueBoolExp bool
}

NativeQueryRequest the structured native request which is evaluated from the raw expression

func EvalNativeQueryRequest added in v0.3.0

func EvalNativeQueryRequest(request *schema.QueryRequest, arguments map[string]any, variables map[string]any) (*NativeQueryRequest, error)

EvalNativeQueryRequest evaluates the requested collection data of the query request

type PredictLinearInput

type PredictLinearInput struct {
	T     float64
	Range client.RangeResolution
}

PredictLinearInput represents input arguments of the predict_linear function

func (*PredictLinearInput) FromValue

func (pli *PredictLinearInput) FromValue(value any, unixTimeUnit client.UnixTimeUnit) error

FromValue decodes data from any value

type QuantileOverTimeInput

type QuantileOverTimeInput struct {
	Quantile float64
	Range    client.RangeResolution
}

QuantileOverTimeInput represents input arguments of the quantile_over_time function

func (*QuantileOverTimeInput) FromValue

func (qoti *QuantileOverTimeInput) FromValue(value any, unixTimeUnit client.UnixTimeUnit) error

FromValue decodes data from any value

type QueryCollectionExecutor

type QueryCollectionExecutor struct {
	Client    *client.Client
	Tracer    trace.Tracer
	Runtime   *metadata.RuntimeSettings
	Request   *schema.QueryRequest
	Metric    metadata.MetricInfo
	Variables map[string]any
	Arguments map[string]any
}

func (*QueryCollectionExecutor) Execute

func (qce *QueryCollectionExecutor) Execute(ctx context.Context) (*schema.RowSet, error)

Execute executes the query request

func (*QueryCollectionExecutor) Explain

Explain explains the query request

type RawQueryExecutor added in v0.3.0

type RawQueryExecutor struct {
	Client    *client.Client
	Tracer    trace.Tracer
	Runtime   *metadata.RuntimeSettings
	Request   *schema.QueryRequest
	Arguments map[string]any
	// contains filtered or unexported fields
}

func (*RawQueryExecutor) Execute added in v0.3.0

func (nqe *RawQueryExecutor) Execute(ctx context.Context) (*schema.RowSet, error)

Execute executes the raw promQL query request

func (*RawQueryExecutor) Explain added in v0.3.0

func (nqe *RawQueryExecutor) Explain(ctx context.Context) (*rawQueryParameters, string, error)

Explain explains the raw promQL query request

type ValueBoundaryInput

type ValueBoundaryInput struct {
	Min float64 `mapstructure:"min"`
	Max float64 `mapstructure:"max"`
}

ValueBoundaryInput represents the lower and upper input arguments

Jump to

Keyboard shortcuts

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