pquerier

package
v0.14.1 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2023 License: Apache-2.0 Imports: 21 Imported by: 3

Documentation

Overview

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Copyright 2018 Iguazio Systems Ltd.

Licensed under the Apache License, Version 2.0 (the "License") with an addition restriction as set forth herein. You may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

In addition, you may not use the software for any purposes that are illegal under applicable law, and the grant of the foregoing license under the Apache 2.0 license is conditioned upon your compliance with such restriction.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRawSeries

func NewRawSeries(results *qryResults, logger logger.Logger) (utils.Series, error)

Types

type Column

type Column interface {
	Len() int                        // Number of elements
	Name() string                    // Column name
	DType() frames.DType             // Data type (e.g. IntType, FloatType ...)
	FloatAt(i int) (float64, error)  // Float value at index i
	StringAt(i int) (string, error)  // String value at index i
	TimeAt(i int) (time.Time, error) // time value at index i
	GetColumnSpec() columnMeta       // Get the column's metadata
	SetDataAt(i int, value interface{}) error
	SetData(d interface{}, size int) error
	GetInterpolationFunction() InterpolationFunction
	FramesColumn() frames.Column
	Delete(index int) error
	// contains filtered or unexported methods
}

Column is a data column

func NewVirtualColumn

func NewVirtualColumn(name string, colSpec columnMeta, size int, function func([]Column, int) (interface{}, error)) Column

type ConcreteColumn

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

func NewConcreteColumn

func NewConcreteColumn(name string, colSpec columnMeta, size int, setFunc func(old, new interface{}) interface{}) *ConcreteColumn

func (*ConcreteColumn) DType

func (c *ConcreteColumn) DType() frames.DType

func (*ConcreteColumn) Delete added in v0.8.9

func (c *ConcreteColumn) Delete(index int) error

func (*ConcreteColumn) FloatAt

func (c *ConcreteColumn) FloatAt(i int) (float64, error)

func (*ConcreteColumn) FramesColumn added in v0.8.9

func (c *ConcreteColumn) FramesColumn() frames.Column

func (*ConcreteColumn) GetColumnSpec

func (c *ConcreteColumn) GetColumnSpec() columnMeta

func (*ConcreteColumn) GetInterpolationFunction

func (c *ConcreteColumn) GetInterpolationFunction() InterpolationFunction

func (*ConcreteColumn) Len

func (c *ConcreteColumn) Len() int

Len returns the number of elements

func (*ConcreteColumn) Name

func (c *ConcreteColumn) Name() string

Name returns the column name

func (*ConcreteColumn) SetData

func (c *ConcreteColumn) SetData(d interface{}, size int) error

func (*ConcreteColumn) SetDataAt

func (c *ConcreteColumn) SetDataAt(i int, val interface{}) error

func (*ConcreteColumn) StringAt

func (c *ConcreteColumn) StringAt(i int) (string, error)

func (*ConcreteColumn) TimeAt

func (c *ConcreteColumn) TimeAt(i int) (time.Time, error)

type DataFrameColumnSeries

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

This series converts two columns into a series of time-value pairs

func NewDataFrameColumnSeries

func NewDataFrameColumnSeries(indexColumn, dataColumn, countColumn Column, labels utils.Labels, hash uint64, showAggregateLabel bool) *DataFrameColumnSeries

func (*DataFrameColumnSeries) GetKey

func (s *DataFrameColumnSeries) GetKey() uint64

func (*DataFrameColumnSeries) Iterator

func (*DataFrameColumnSeries) Labels

func (s *DataFrameColumnSeries) Labels() utils.Labels

type FrameSet

type FrameSet interface {
	NextFrame() bool
	GetFrame() (frames.Frame, error)
	Err() error
}

SeriesSet contains a set of series.

type InterpolationFunction

type InterpolationFunction func(tprev, tnext, tseek int64, vprev, vnext float64) (int64, float64)

func GetInterpolateFunc

func GetInterpolateFunc(alg InterpolationType, tolerance int64) InterpolationFunction

return line interpolation function, estimate seek value based on previous and next points

type InterpolationType

type InterpolationType uint8

func StrToInterpolateType

func StrToInterpolateType(str string) (InterpolationType, error)

func (InterpolationType) String added in v0.8.8

func (it InterpolationType) String() string

type RawChunkIterator added in v0.8.8

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

Chunk-list series iterator

func (*RawChunkIterator) AddChunks added in v0.8.8

func (it *RawChunkIterator) AddChunks(item *qryResults)

func (*RawChunkIterator) At added in v0.8.8

func (it *RawChunkIterator) At() (t int64, v float64)

Read the time and value at the current location

func (*RawChunkIterator) AtString added in v0.8.8

func (it *RawChunkIterator) AtString() (t int64, v string)

func (*RawChunkIterator) Encoding added in v0.8.8

func (it *RawChunkIterator) Encoding() chunkenc.Encoding

func (*RawChunkIterator) Err added in v0.8.8

func (it *RawChunkIterator) Err() error

func (*RawChunkIterator) Next added in v0.8.8

func (it *RawChunkIterator) Next() bool

Move to the next iterator item

func (*RawChunkIterator) PeakBack added in v0.8.8

func (it *RawChunkIterator) PeakBack() (t int64, v float64)

func (*RawChunkIterator) Seek added in v0.8.8

func (it *RawChunkIterator) Seek(t int64) bool

Advance the iterator to the specified chunk and time

type RequestedColumn

type RequestedColumn struct {
	Metric                 string
	Alias                  string
	Function               string
	Interpolator           string
	InterpolationTolerance int64 // tolerance in Millis
}

func (*RequestedColumn) GetColumnName added in v0.9.2

func (col *RequestedColumn) GetColumnName() string

func (*RequestedColumn) GetFunction added in v0.8.4

func (col *RequestedColumn) GetFunction() string

If the function is cross series, remove the suffix otherwise leave it as is

type SelectParams

type SelectParams struct {
	Name              string
	Functions         string
	From, To, Step    int64
	Windows           []int
	Filter            string
	RequestedColumns  []RequestedColumn
	GroupBy           string
	AggregationWindow int64
	UseOnlyClientAggr bool
	// contains filtered or unexported fields
}

func ParseQuery added in v0.8.7

func ParseQuery(sql string) (*SelectParams, string, error)

ParseQuery Parses an sql query into `tsdb.selectParams` Currently supported syntax: select - selecting multiple metrics, aggregations, interpolation functions and aliasing from - only one table where - equality, and range operators. Not supporting regex,`IS NULL`, etc.. group by

type V3ioQuerier

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

func NewV3ioQuerier

func NewV3ioQuerier(container v3io.Container, logger logger.Logger,
	cfg *config.V3ioConfig, partMngr *partmgr.PartitionManager) *V3ioQuerier

Create a new Querier interface

func (*V3ioQuerier) GetLabelSets

func (q *V3ioQuerier) GetLabelSets(metric string, filter string) ([]utils.Labels, error)

Returns all unique labels sets we have in the data

func (*V3ioQuerier) LabelNames added in v0.9.0

func (q *V3ioQuerier) LabelNames() ([]string, error)

Stub

func (*V3ioQuerier) LabelValues

func (q *V3ioQuerier) LabelValues(labelKey string) (result []string, err error)

Return the current metric names

func (*V3ioQuerier) Select

func (q *V3ioQuerier) Select(params *SelectParams) (utils.SeriesSet, error)

Base query function

func (*V3ioQuerier) SelectDataFrame

func (q *V3ioQuerier) SelectDataFrame(params *SelectParams) (FrameSet, error)

func (*V3ioQuerier) SelectProm

func (q *V3ioQuerier) SelectProm(params *SelectParams, noAggr bool) (utils.SeriesSet, error)

type V3ioRawSeries

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

func (*V3ioRawSeries) AddChunks

func (s *V3ioRawSeries) AddChunks(results *qryResults)

func (*V3ioRawSeries) GetKey

func (s *V3ioRawSeries) GetKey() uint64

Get the unique series key for sorting

func (*V3ioRawSeries) Iterator

func (s *V3ioRawSeries) Iterator() utils.SeriesIterator

func (*V3ioRawSeries) Labels

func (s *V3ioRawSeries) Labels() utils.Labels

Jump to

Keyboard shortcuts

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