tile

package
v0.15.17-hotfix.5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	// FrameSize is the frame size in nanos.
	FrameSize time.Duration
	// Start is the start time for the iterator in nanos from epoch.
	Start xtime.UnixNano
	// EncodingOpts are options for the encoder.
	EncodingOpts encoding.Options
	// ReaderIteratorPool yields ReaderIterators.
	ReaderIteratorPool encoding.ReaderIteratorPool
}

Options are series block iterator options.

type SeriesBlockFrame

type SeriesBlockFrame struct {
	// FrameStartInclusive is inclusive start of frame.
	FrameStartInclusive xtime.UnixNano
	// FrameEndExclusive is exclusive end of frame.
	FrameEndExclusive xtime.UnixNano
	// contains filtered or unexported fields
}

SeriesBlockFrame contains either all raw values for a given series in a block if the frame size was not specified, or the number of values that fall into the next sequential frame for a series in the block given the progression through each time series from the query Start time. e.g. with 10minute frame size that aligns with the query start, each series will return 12 frames in a two hour block.

func (*SeriesBlockFrame) Annotations

func (f *SeriesBlockFrame) Annotations() SeriesFrameAnnotations

Annotations returns annotations for the SeriesBlockFrame.

func (*SeriesBlockFrame) Timestamps

func (f *SeriesBlockFrame) Timestamps() []time.Time

Timestamps returns timestamps for the SeriesBlockFrame.

func (*SeriesBlockFrame) Units

Units returns units for the SeriesBlockFrame.

func (*SeriesBlockFrame) Values

func (f *SeriesBlockFrame) Values() []float64

Values returns values in this SeriesBlockFrame.

type SeriesBlockIterator

type SeriesBlockIterator interface {
	// Err returns any errors encountered.
	Err() error
	// Next moves to the next element.
	Next() bool
	// Close closes the iterator.
	Close() error
	// Current returns the next set of series frame iterators.
	Current() (SeriesFrameIterator, ident.ID, ts.EncodedTags)
}

SeriesBlockIterator provides concurrent iteration across multiple series in a frame-wise fashion.

func NewSeriesBlockIterator

func NewSeriesBlockIterator(
	reader fs.CrossBlockReader,
	opts Options,
) (SeriesBlockIterator, error)

NewSeriesBlockIterator creates a new SeriesBlockIterator.

type SeriesFrameAnnotations

type SeriesFrameAnnotations interface {
	// SingleValue returns the last annotation seen, and a boolean indicating if
	// that annotation is constant for all datapoints accross the series frame.
	SingleValue() (ts.Annotation, bool)

	// Values returns all values seen.
	// NB: if this is called on a recorder with a constant annotation, this will
	// generate a full slice filled with that annotation, corresponding to the
	// number of annotations added to the recorder. It is recommended to call
	// SingleValue first to avoid unnecessary allocs if SingleValue is true.
	Values() []ts.Annotation
}

SeriesFrameAnnotations describes annotations in this series frame.

type SeriesFrameIterator

type SeriesFrameIterator interface {
	// Err returns any errors encountered.
	Err() error
	// Next moves to the next element.
	Next() bool
	// Close closes the iterator.
	Close() error
	// Current returns the current series block frame.
	Current() SeriesBlockFrame
	// Reset resets the series frame iterator.
	Reset(
		start xtime.UnixNano,
		step time.Duration,
		iter fs.CrossBlockIterator,
	) error
}

SeriesFrameIterator is a frame-wise iterator across a series block.

type SeriesFrameUnits

type SeriesFrameUnits interface {
	// SingleValue returns the last unit seen, and a boolean indicating if
	// that unit is constant for all datapoints accross the series frame.
	SingleValue() (xtime.Unit, bool)

	// Values returns all values seen.
	// NB: if this is called on a recorder with a constant unit, this will
	// generate a full slice filled with that unit, corresponding to the
	// number of units added to the recorder. It is recommended to call
	// SingleValue first to avoid unnecessary allocs if SingleValue is true.
	Values() []xtime.Unit
}

SeriesFrameUnits describes units in this series frame.

Jump to

Keyboard shortcuts

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