tsdb: github.com/prometheus/tsdb/tsdbutil Index | Files

package tsdbutil

import "github.com/prometheus/tsdb/tsdbutil"

Index

Package Files

buffer.go chunks.go

func ChunkFromSamples Uses

func ChunkFromSamples(s []Sample) chunks.Meta

func PopulatedChunk Uses

func PopulatedChunk(numSamples int, minTime int64) chunks.Meta

PopulatedChunk creates a chunk populated with samples every second starting at minTime

type BufferedSeriesIterator Uses

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

BufferedSeriesIterator wraps an iterator with a look-back buffer.

func NewBuffer Uses

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) At Uses

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

At returns the current element of the iterator.

func (*BufferedSeriesIterator) Buffer Uses

func (b *BufferedSeriesIterator) Buffer() SeriesIterator

Buffer returns an iterator over the buffered data.

func (*BufferedSeriesIterator) Err Uses

func (b *BufferedSeriesIterator) Err() error

Err returns the last encountered error.

func (*BufferedSeriesIterator) Next Uses

func (b *BufferedSeriesIterator) Next() bool

Next advances the iterator to the next element.

func (*BufferedSeriesIterator) PeekBack Uses

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

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

func (*BufferedSeriesIterator) Seek Uses

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

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

type Sample Uses

type Sample interface {
    T() int64
    V() float64
}

type SeriesIterator Uses

type SeriesIterator interface {
    // Seek advances the iterator forward to the given timestamp.
    // If there's no value exactly at t, it advances to the first value
    // after t.
    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.

Package tsdbutil imports 3 packages (graph). Updated 2018-11-25. Refresh now. Tools for package owners.