storage

package
v2.0.0-beta.0+incompat... Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound                    = errors.New("not found")
	ErrOutOfOrderSample            = errors.New("out of order sample")
	ErrDuplicateSampleForTimestamp = errors.New("duplicate sample for timestamp")
	ErrOutOfBounds                 = errors.New("out of bounds")
)

The errors exposed.

Functions

This section is empty.

Types

type Appender added in v1.29.3

type Appender interface {
	Add(l labels.Labels, t int64, v float64) (string, error)

	AddFast(ref string, t int64, v float64) error

	// Commit submits the collected samples and purges the batch.
	Commit() error

	Rollback() error
}

Appender provides batched appends against a storage.

type BufferedSeriesIterator added in v1.29.3

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

BufferedSeriesIterator wraps an iterator with a look-back buffer.

func NewBuffer added in v1.29.3

func NewBuffer(it SeriesIterator, delta int64) *BufferedSeriesIterator

NewBuffer returns a new iterator that buffers the values within the time range of the current element and the duration of delta before.

func (*BufferedSeriesIterator) Buffer added in v1.29.3

Buffer returns an iterator over the buffered data.

func (*BufferedSeriesIterator) Err added in v1.29.3

func (b *BufferedSeriesIterator) Err() error

Err returns the last encountered error.

func (*BufferedSeriesIterator) Next added in v1.29.3

func (b *BufferedSeriesIterator) Next() bool

Next advances the iterator to the next element.

func (*BufferedSeriesIterator) PeekBack added in v1.29.3

func (b *BufferedSeriesIterator) PeekBack(n int) (t int64, v float64, ok bool)

PeekBack returns the nth previous element of the iterator. If there is none buffered, ok is false.

func (*BufferedSeriesIterator) Seek added in v1.29.3

func (b *BufferedSeriesIterator) Seek(t int64) bool

Seek advances the iterator to the element at time t or greater.

func (*BufferedSeriesIterator) Values added in v1.29.3

func (b *BufferedSeriesIterator) Values() (int64, float64)

Values returns the current element of the iterator.

type Querier added in v1.29.3

type Querier interface {
	// Select returns a set of series that matches the given label matchers.
	Select(...*labels.Matcher) SeriesSet

	// LabelValues returns all potential values for a label name.
	LabelValues(name string) ([]string, error)

	// Close releases the resources of the Querier.
	Close() error
}

Querier provides reading access to time series data.

type Series added in v1.29.3

type Series interface {
	// Labels returns the complete set of labels identifying the series.
	Labels() labels.Labels

	// Iterator returns a new iterator of the data of the series.
	Iterator() SeriesIterator
}

Series represents a single time series.

type SeriesIterator

type SeriesIterator interface {
	// Seek advances the iterator forward to the value at or after
	// the given timestamp.
	Seek(t int64) bool
	// At returns the current timestamp/value pair.
	At() (t int64, v float64)
	// Next advances the iterator by one.
	Next() bool
	// Err returns the current error.
	Err() error
}

SeriesIterator iterates over the data of a time series.

type SeriesSet added in v1.29.3

type SeriesSet interface {
	Next() bool
	At() Series
	Err() error
}

SeriesSet contains a set of series.

func DeduplicateSeriesSet

func DeduplicateSeriesSet(a, b SeriesSet) SeriesSet

DeduplicateSeriesSet merges two SeriesSet and removes duplicates. If two series exist in both sets, their datapoints must be equal.

type Storage added in v1.29.3

type Storage interface {
	// Querier returns a new Querier on the storage.
	Querier(mint, maxt int64) (Querier, error)

	// Appender returns a new appender against the storage.
	Appender() (Appender, error)

	// Close closes the storage and all its underlying resources.
	Close() error
}

Storage ingests and manages samples, along with various indexes. All methods are goroutine-safe. Storage implements storage.SampleAppender.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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