Documentation ¶
Index ¶
- func ChunkFromSamples(s []Sample) chunks.Meta
- func ChunkFromSamplesGeneric(s Samples) chunks.Meta
- func PopulatedChunk(numSamples int, minTime int64) chunks.Meta
- func TestDirLockerUsage(t *testing.T, ...)
- type BufferedSeriesIterator
- func (b *BufferedSeriesIterator) At() (int64, float64)
- func (b *BufferedSeriesIterator) Buffer() chunkenc.Iterator
- func (b *BufferedSeriesIterator) Err() error
- func (b *BufferedSeriesIterator) Next() bool
- func (b *BufferedSeriesIterator) PeekBack() (t int64, v float64, ok bool)
- func (b *BufferedSeriesIterator) Seek(t int64) bool
- type DirLocker
- type Sample
- type SampleSlice
- type Samples
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChunkFromSamples ¶
func ChunkFromSamplesGeneric ¶
func PopulatedChunk ¶
PopulatedChunk creates a chunk populated with samples every second starting at minTime
func TestDirLockerUsage ¶
func TestDirLockerUsage(t *testing.T, open func(t *testing.T, data string, createLock bool) (*DirLocker, testutil.Closer))
TestDirLockerUsage performs a set of tests which guarantee correct usage of DirLocker. open should use data as the storage directory, and createLock to determine if a lock file should be used.
Types ¶
type BufferedSeriesIterator ¶
type BufferedSeriesIterator struct {
// contains filtered or unexported fields
}
BufferedSeriesIterator wraps an iterator with a look-back buffer.
func NewBuffer ¶
func NewBuffer(it chunkenc.Iterator, 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 ¶
func (b *BufferedSeriesIterator) At() (int64, float64)
At returns the current element of the iterator.
func (*BufferedSeriesIterator) Buffer ¶
func (b *BufferedSeriesIterator) Buffer() chunkenc.Iterator
Buffer returns an iterator over the buffered data.
func (*BufferedSeriesIterator) Err ¶
func (b *BufferedSeriesIterator) Err() error
Err returns the last encountered error.
func (*BufferedSeriesIterator) Next ¶
func (b *BufferedSeriesIterator) Next() bool
Next advances the iterator to the next element.
func (*BufferedSeriesIterator) PeekBack ¶
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 ¶
func (b *BufferedSeriesIterator) Seek(t int64) bool
Seek advances the iterator to the element at time t or greater.
type DirLocker ¶
type DirLocker struct {
// contains filtered or unexported fields
}
func NewDirLocker ¶
func NewDirLocker(dir, subsystem string, l log.Logger, r prometheus.Registerer) (*DirLocker, error)
NewDirLocker creates a DirLocker that can obtain an exclusive lock on dir.
type Sample ¶
func GenerateSamples ¶
GenerateSamples starting at start and counting up numSamples.
type SampleSlice ¶
type SampleSlice []Sample
func (SampleSlice) Get ¶
func (s SampleSlice) Get(i int) Sample
func (SampleSlice) Len ¶
func (s SampleSlice) Len() int