influxdb

package
v0.0.0-...-31263be Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

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 to run models.PromCommand. It contains a reference to QueryCommandRunnerFactory instance for putting itself back to the factory from which it was born after work.

func (*QueryCommandRunner) ApplyOpts

func (receiver *QueryCommandRunner) ApplyOpts(opts QueryCommandRunnerOpts)

func (*QueryCommandRunner) InfluxLiteralToPromQLValue

func (receiver *QueryCommandRunner) InfluxLiteralToPromQLValue(result influxql.Literal, cmd prommodels.PromCommand) (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 prommodels.PromCommand) (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) 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

Run executes models.PromCommand and returns final results

type QueryCommandRunnerConfig

type QueryCommandRunnerConfig struct {
	// Timeout sets timeout duration for a single query execution
	Timeout time.Duration
	// Verbose indicates whether to output more logs or not
	Verbose bool
}

type QueryCommandRunnerFactory

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

QueryCommandRunnerFactory is responsible for creating QueryCommandRunner instances. It contains an object pool for performance and memory effective.

var SingletonQueryCommandRunnerFactory *QueryCommandRunnerFactory

func (*QueryCommandRunnerFactory) Build

Build returns an QueryCommandRunner instance from object pool

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
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.
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