Documentation ¶
Index ¶
- type QueryCommandRunner
- func (receiver *QueryCommandRunner) ApplyOpts(opts QueryCommandRunnerOpts)
- func (receiver *QueryCommandRunner) InfluxLiteralToPromQLValue(result influxql.Literal, cmd prommodels.PromCommand) (value parser.Value, resultType string)
- func (receiver *QueryCommandRunner) InfluxResultToPromQLValue(results []influxdb.Result, expr parser.Expr, cmd prommodels.PromCommand) (value parser.Value, resultType string, err error)
- func (receiver *QueryCommandRunner) InfluxResultToStringSlice(results []influxdb.Result, dest *[]string) error
- func (receiver *QueryCommandRunner) Recycle()
- func (receiver *QueryCommandRunner) Run(ctx context.Context, cmd models.PromCommand) (models.RunResult, error)
- type QueryCommandRunnerConfig
- type QueryCommandRunnerFactory
- type QueryCommandRunnerOpts
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 ¶
func (receiver *QueryCommandRunner) Run(ctx context.Context, cmd models.PromCommand) (models.RunResult, error)
Run executes models.PromCommand and returns final results
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 ¶
func (receiver *QueryCommandRunnerFactory) Build(client influxdb.Client, cfg QueryCommandRunnerConfig) *QueryCommandRunner
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 |