influxql

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrNotImplemented

func ErrNotImplemented(op string) error

ErrNotImplemented creates a NotImplementedError specifying op is unavailable.

Types

type CollectorFn

type CollectorFn func() Statistics

func (CollectorFn) Statistics

func (fn CollectorFn) Statistics() Statistics

type EncodingFormat

type EncodingFormat int
const (
	EncodingFormatJSON EncodingFormat = iota
	EncodingFormatTextCSV
	EncodingFormatAppCSV
	EncodingFormatMessagePack
)

func EncodingFormatFromMimeType

func EncodingFormatFromMimeType(s string) EncodingFormat

Returns closed encoding format from the specified mime type. The default is JSON if no exact match is found.

func (EncodingFormat) ContentType

func (f EncodingFormat) ContentType() string

func (EncodingFormat) MarshalJSON

func (f EncodingFormat) MarshalJSON() ([]byte, error)

func (*EncodingFormat) UnmarshalJSON

func (f *EncodingFormat) UnmarshalJSON(bytes []byte) error

type ImmutableCollector

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

func NewImmutableCollector

func NewImmutableCollector(s Statistics) *ImmutableCollector

func (*ImmutableCollector) Statistics

func (c *ImmutableCollector) Statistics() Statistics

type MutableCollector

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

func NewMutableCollector

func NewMutableCollector(s *Statistics) *MutableCollector

func (*MutableCollector) Statistics

func (c *MutableCollector) Statistics() Statistics

type NotImplementedError

type NotImplementedError struct {
	Op string // Op is the name of the unimplemented operation
}

NotImplementedError is returned when a specific operation is unavailable.

func (*NotImplementedError) Error

func (e *NotImplementedError) Error() string

type ProxyMode

type ProxyMode byte

ProxyMode enumerates the possible ProxyQueryService operating modes used by a downstream client.

const (
	// ProxyModeHTTP specifies a ProxyQueryService that forwards InfluxQL requests via HTTP to influxqld.
	ProxyModeHTTP ProxyMode = iota

	// ProxyModeQueue specifies a ProxyQueryService that pushes InfluxQL requests to a queue and influxqld issues a callback request to the initiating service.
	ProxyModeQueue
)

func (*ProxyMode) Set

func (i *ProxyMode) Set(v string) (err error)

func (ProxyMode) String

func (i ProxyMode) String() string

func (*ProxyMode) Type

func (i *ProxyMode) Type() string

type ProxyQueryService

type ProxyQueryService interface {
	check.Checker
	Query(ctx context.Context, w io.Writer, req *QueryRequest) (Statistics, error)
}

ProxyQueryService performs InfluxQL queries and encodes the result into a writer. The results are opaque to a ProxyQueryService.

type QueryRequest

type QueryRequest struct {
	Authorization  *influxdb.Authorization `json:"authorization,omitempty"`
	OrganizationID platform.ID             `json:"organization_id"`
	DB             string                  `json:"db"`
	RP             string                  `json:"rp"`
	Epoch          string                  `json:"epoch"`
	EncodingFormat EncodingFormat          `json:"encoding_format"`
	ContentType    string                  `json:"content_type"` // Content type is the desired response format.
	Chunked        bool                    `json:"chunked"`      // Chunked indicates responses should be chunked using ChunkSize
	ChunkSize      int                     `json:"chunk_size"`   // ChunkSize is the number of points to be encoded per batch. 0 indicates no chunking.
	Query          string                  `json:"query"`        // Query contains the InfluxQL.
	Params         map[string]interface{}  `json:"params,omitempty"`
	Source         string                  `json:"source"` // Source represents the ultimate source of the request.
}

func (*QueryRequest) Valid

func (r *QueryRequest) Valid() error

The HTTP query requests represented the body expected by the QueryHandler

type RequestMode

type RequestMode byte

RequestMode is enumerates the possible influxqld operating modes for receiving InfluxQL requests.

const (
	// RequestModeHTTP specifies the HTTP listener should be active.
	RequestModeHTTP RequestMode = iota

	// RequestModeQueue specifies the queue dispatcher should be active.
	RequestModeQueue

	// RequestModeAll specifies both the HTTP listener and queue dispatcher should be active.
	RequestModeAll
)

func (*RequestMode) Set

func (i *RequestMode) Set(v string) (err error)

func (RequestMode) String

func (i RequestMode) String() string

func (*RequestMode) Type

func (i *RequestMode) Type() string

type Statistics

type Statistics struct {
	PlanDuration    time.Duration `json:"plan_duration"`    // PlanDuration is the duration spent planning the query.
	ExecuteDuration time.Duration `json:"execute_duration"` // ExecuteDuration is the duration spent executing the query.
	StatementCount  int           `json:"statement_count"`  // StatementCount is the number of InfluxQL statements executed
	ScannedValues   int           `json:"scanned_values"`   // ScannedValues is the number of values scanned from storage
	ScannedBytes    int           `json:"scanned_bytes"`    // ScannedBytes is the number of bytes scanned from storage
}

Statistics is a collection of statistics about the processing of a query.

func (*Statistics) Add

func (s *Statistics) Add(other Statistics)

Add adds other to s.

func (Statistics) Adding

func (s Statistics) Adding(other Statistics) Statistics

Adding returns the sum of s and other.

func (*Statistics) LogToSpan

func (s *Statistics) LogToSpan(span opentracing.Span)

func (*Statistics) TotalDuration

func (s *Statistics) TotalDuration() time.Duration

TotalDuration returns the sum of all durations for s.

type StatisticsCollector

type StatisticsCollector interface {
	Statistics() Statistics
}

type StatisticsGatherer

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

func (*StatisticsGatherer) Append

func (sg *StatisticsGatherer) Append(sc StatisticsCollector)

func (*StatisticsGatherer) Reset

func (sg *StatisticsGatherer) Reset()

func (*StatisticsGatherer) Statistics

func (sg *StatisticsGatherer) Statistics() Statistics

Directories

Path Synopsis
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
neldermead
Package neldermead is an implementation of the Nelder-Mead optimization method.
Package neldermead is an implementation of the Nelder-Mead optimization method.

Jump to

Keyboard shortcuts

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