promql

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PROMQL_DIALECT command.DialectType = "promql"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type QueryCommandRunner

type QueryCommandRunner struct {
	Cfg     QueryCommandRunnerConfig
	Client  influxdb.Client
	Factory *QueryCommandRunnerFactory
}

QueryCommandRunner is a query engine that implements command.ICommandRunner to run command.Command It also implements command.IReusableCommandRunner to put itself back to the factory from which it was born

func (*QueryCommandRunner) ApplyOpts

func (receiver *QueryCommandRunner) ApplyOpts(opts QueryCommandRunnerOpts)

func (*QueryCommandRunner) InfluxLiteralToPromQLValue

func (receiver *QueryCommandRunner) InfluxLiteralToPromQLValue(result influxql.Literal, cmd command.Command) (value parser.Value, resultType string)

InfluxLiteralToPromQLValue converts influxql.Literal expression to parser.Value of Prometheus

func (*QueryCommandRunner) InfluxResultToPromQLValue

func (receiver *QueryCommandRunner) InfluxResultToPromQLValue(results []influxdb.Result, expr parser.Expr, cmd command.Command) (value parser.Value, resultType string, err error)

InfluxResultToPromQLValue converts influxdb.Result slice to parser.Value of Prometheus

func (*QueryCommandRunner) InfluxResultToStringSlice

func (receiver *QueryCommandRunner) InfluxResultToStringSlice(results []influxdb.Result, dest *[]string, expr parser.Expr, cmd command.Command) error

InfluxResultToStringSlice converts influxdb.Result slice to string slice

func (*QueryCommandRunner) Recycle

func (receiver *QueryCommandRunner) Recycle()

Recycle puts callee back to its factory

func (*QueryCommandRunner) Run

func (receiver *QueryCommandRunner) Run(ctx context.Context, cmd command.Command) (interface{}, error)

Run executes command.Command and returns final results

type QueryCommandRunnerConfig

type QueryCommandRunnerConfig struct {
	config.Config
}

type QueryCommandRunnerFactory

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

QueryCommandRunnerFactory is a concrete struct that implementing command.ICommandRunnerFactory in charge of create command.ICommandRunner instances. it wraps

func NewQueryCommandRunnerFactory

func NewQueryCommandRunnerFactory() *QueryCommandRunnerFactory

NewQueryCommandRunnerFactory creates a package-level factory method for creating *QueryCommandRunner

func (*QueryCommandRunnerFactory) Build

Build returns a command.ICommandRunner instance

func (*QueryCommandRunnerFactory) Recycle

func (receiver *QueryCommandRunnerFactory) Recycle(runner *QueryCommandRunner)

Recycle puts *QueryCommandRunner back to object pool

type QueryCommandRunnerOpts

type QueryCommandRunnerOpts struct {
	Cfg     QueryCommandRunnerConfig
	Client  influxdb.Client
	Factory *QueryCommandRunnerFactory
}

type RunResult

type RunResult struct {
	Result     interface{}
	ResultType string
	Error      error
}

RunResult wraps query result and possible error

Directories

Path Synopsis
Package testinghelper only for testing purpose
Package testinghelper only for testing purpose

Jump to

Keyboard shortcuts

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