internal

package
v0.0.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 AggregateGroupBy

type AggregateGroupBy struct {
	By      []string
	Without []string
}

AggregateGroupBy represents the aggregate group by object

func (*AggregateGroupBy) FromValue

func (agb *AggregateGroupBy) FromValue(input map[string]any) error

FromValue decodes property values from an input object

func (AggregateGroupBy) String

func (agb AggregateGroupBy) String() string

String implement the fmt.Stringer interface

type AggregateK

type AggregateK struct {
	AggregateGroupBy

	K int64
}

AggregateK represents the object argument of topK and bottomK object

func (*AggregateK) FromValue

func (agb *AggregateK) FromValue(input map[string]any) error

FromValue decodes property values from an input object

type AggregateRangeUnwrapInput

type AggregateRangeUnwrapInput struct {
	Range              time.Duration
	Unwrap             string
	ConversionFunction *metadata.ConversionFunction
}

AggregateRangeUnwrapInput represents an aggregate range with unwrap input argument

func (*AggregateRangeUnwrapInput) FromValue

func (aru *AggregateRangeUnwrapInput) FromValue(input map[string]any, unitTimeUnit metadata.UnixTimeUnit) error

FromValue decodes property values from an input object

func (AggregateRangeUnwrapInput) String

func (aru AggregateRangeUnwrapInput) String() string

String implement the fmt.Stringer interface

type BaseQueryRequest

type BaseQueryRequest struct {
	Timestamp *time.Time
	Start     *time.Time
	End       *time.Time
	Since     *scalar.Duration
	Interval  *scalar.Duration
	Step      *scalar.Duration
	Flat      *bool
	OrderBy   []ColumnOrder
	Variables map[string]any
	// contains filtered or unexported fields
}

BaseQueryRequest represents the common query request structure

func (BaseQueryRequest) FindTimestampOrderBy

func (bqr BaseQueryRequest) FindTimestampOrderBy() *ColumnOrder

FindTimestampOrderBy checks and returns the first timestamp order by item if exist

func (BaseQueryRequest) GetFlat

func (bqr BaseQueryRequest) GetFlat() bool

GetFlat gets the flat boolean value

func (BaseQueryRequest) GetQueryDirection

func (bqr BaseQueryRequest) GetQueryDirection() *client.QueryDirection

GetQueryDirection gets the query direction if exist

type CollectionRequest

type CollectionRequest struct {
	*BaseQueryRequest
	LogLine          *schema.ExpressionBinaryComparisonOperator
	MetricValue      *schema.ExpressionBinaryComparisonOperator
	LabelExpressions map[string]LabelExpression
	FieldExpression  schema.ExpressionEncoder
	Aggregations     []KeyValue
}

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

func EvalCollectionRequest

func EvalCollectionRequest(request *schema.QueryRequest, model metadata.ModelInfo, arguments map[string]any, variables map[string]any, runtime *metadata.RuntimeSettings) (*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 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

	Labels map[string]metadata.ModelLabelInfo
	// 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 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

type NativeQueryRequest struct {
	*BaseQueryRequest
	Expression      schema.Expression
	HasValueBoolExp bool
}

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

func EvalNativeQueryRequest

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

EvalNativeQueryRequest evaluates the requested collection data of the query request

type QuantileOverTimeInput

type QuantileOverTimeInput struct {
	AggregateRangeUnwrapInput

	Quantile float64
}

QuantileOverTimeInput represents an input argument for the QuantileOverTime aggregation

func (*QuantileOverTimeInput) FromValue

func (qot *QuantileOverTimeInput) FromValue(input map[string]any, unitTimeUnit metadata.UnixTimeUnit) error

FromValue decodes property values from an input object

type QueryCollectionExecutor

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

QueryCollectionExecutor evaluates and executes the query request.

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

Jump to

Keyboard shortcuts

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