Versions in this module Expand all Collapse all v0 v0.2.0 Nov 16, 2018 Changes in this version type Querier + LabelNames func() ([]string, error) v0.1.0 Nov 15, 2018 Changes in this version + const MagicTombstone + const WALFormatDefault + const WALMagic + var DefaultOptions = &Options + var ErrAmendSample = errors.New("amending sample") + var ErrClosing = errors.New("block is closing") + var ErrNotFound = errors.Errorf("not found") + var ErrOutOfBounds = errors.New("out of bounds") + var ErrOutOfOrderSample = errors.New("out of order sample") + func DeleteCheckpoints(dir string, maxIndex int) error + func ExponentialBlockRanges(minSize int64, steps, stepSize int) []int64 + func LastCheckpoint(dir string) (string, int, error) + func MigrateWAL(logger log.Logger, dir string) (err error) + func PostingsForMatchers(ix IndexReader, ms ...labels.Matcher) (index.Postings, error) + type Appendable interface + Appender func() Appender + type Appender interface + Add func(l labels.Labels, t int64, v float64) (uint64, error) + AddFast func(ref uint64, t int64, v float64) error + Commit func() error + Rollback func() error + type Block struct + func OpenBlock(dir string, pool chunkenc.Pool) (*Block, error) + func (pb *Block) Chunks() (ChunkReader, error) + func (pb *Block) CleanTombstones(dest string, c Compactor) (*ulid.ULID, error) + func (pb *Block) Close() error + func (pb *Block) Delete(mint, maxt int64, ms ...labels.Matcher) error + func (pb *Block) Dir() string + func (pb *Block) GetSymbolTableSize() uint64 + func (pb *Block) Index() (IndexReader, error) + func (pb *Block) LabelNames() ([]string, error) + func (pb *Block) Meta() BlockMeta + func (pb *Block) OverlapsClosedInterval(mint, maxt int64) bool + func (pb *Block) Snapshot(dir string) error + func (pb *Block) String() string + func (pb *Block) Tombstones() (TombstoneReader, error) + type BlockDesc struct + MaxTime int64 + MinTime int64 + ULID ulid.ULID + type BlockMeta struct + Compaction BlockMetaCompaction + MaxTime int64 + MinTime int64 + Stats BlockStats + ULID ulid.ULID + Version int + type BlockMetaCompaction struct + Failed bool + Level int + Parents []BlockDesc + Sources []ulid.ULID + type BlockReader interface + Chunks func() (ChunkReader, error) + Index func() (IndexReader, error) + Tombstones func() (TombstoneReader, error) + type BlockStats struct + NumChunks uint64 + NumSamples uint64 + NumSeries uint64 + NumTombstones uint64 + type CheckpointStats struct + DroppedSamples int + DroppedSeries int + DroppedTombstones int + TotalSamples int + TotalSeries int + TotalTombstones int + func Checkpoint(w *wal.WAL, from, to int, keep func(id uint64) bool, mint int64) (*CheckpointStats, error) + type ChunkReader interface + Chunk func(ref uint64) (chunkenc.Chunk, error) + Close func() error + type ChunkSeriesSet interface + At func() (labels.Labels, []chunks.Meta, Intervals) + Err func() error + Next func() bool + func LookupChunkSeries(ir IndexReader, tr TombstoneReader, ms ...labels.Matcher) (ChunkSeriesSet, error) + type ChunkWriter interface + Close func() error + WriteChunks func(chunks ...chunks.Meta) error + type Compactor interface + Compact func(dest string, dirs []string, open []*Block) (ulid.ULID, error) + Plan func(dir string) ([]string, error) + Write func(dest string, b BlockReader, mint, maxt int64, parent *BlockMeta) (ulid.ULID, error) + type DB struct + func Open(dir string, l log.Logger, r prometheus.Registerer, opts *Options) (db *DB, err error) + func (db *DB) Appender() Appender + func (db *DB) Blocks() []*Block + func (db *DB) CleanTombstones() (err error) + func (db *DB) Close() error + func (db *DB) Delete(mint, maxt int64, ms ...labels.Matcher) error + func (db *DB) Dir() string + func (db *DB) DisableCompactions() + func (db *DB) EnableCompactions() + func (db *DB) Head() *Head + func (db *DB) LabelNames() ([]string, error) + func (db *DB) Querier(mint, maxt int64) (Querier, error) + func (db *DB) Snapshot(dir string, withHead bool) error + func (db *DB) String() string + type Head struct + func NewHead(r prometheus.Registerer, l log.Logger, wal *wal.WAL, chunkRange int64) (*Head, error) + func (h *Head) Appender() Appender + func (h *Head) Chunks() (ChunkReader, error) + func (h *Head) Close() error + func (h *Head) Delete(mint, maxt int64, ms ...labels.Matcher) error + func (h *Head) Index() (IndexReader, error) + func (h *Head) Init() error + func (h *Head) MaxTime() int64 + func (h *Head) MinTime() int64 + func (h *Head) Tombstones() (TombstoneReader, error) + func (h *Head) Truncate(mint int64) (err error) + type IndexReader interface + Close func() error + LabelIndices func() ([][]string, error) + LabelNames func() ([]string, error) + LabelValues func(names ...string) (index.StringTuples, error) + Postings func(name, value string) (index.Postings, error) + Series func(ref uint64, lset *labels.Labels, chks *[]chunks.Meta) error + SortedPostings func(index.Postings) index.Postings + Symbols func() (map[string]struct{}, error) + type IndexWriter interface + AddSeries func(ref uint64, l labels.Labels, chunks ...chunks.Meta) error + AddSymbols func(sym map[string]struct{}) error + Close func() error + WriteLabelIndex func(names []string, values []string) error + WritePostings func(name, value string, it index.Postings) error + type Interval struct + Maxt int64 + Mint int64 + type Intervals []Interval + type LeveledCompactor struct + func NewLeveledCompactor(r prometheus.Registerer, l log.Logger, ranges []int64, pool chunkenc.Pool) (*LeveledCompactor, error) + func (c *LeveledCompactor) Compact(dest string, dirs []string, open []*Block) (uid ulid.ULID, err error) + func (c *LeveledCompactor) Plan(dir string) ([]string, error) + func (c *LeveledCompactor) Write(dest string, b BlockReader, mint, maxt int64, parent *BlockMeta) (ulid.ULID, error) + type MultiError []error + func (es *MultiError) Add(err error) + func (es MultiError) Err() error + func (es MultiError) Error() string + type Options struct + BlockRanges []int64 + NoLockfile bool + RetentionDuration uint64 + WALFlushInterval time.Duration + type Overlaps map[TimeRange][]BlockMeta + func OverlappingBlocks(bm []BlockMeta) Overlaps + func (o Overlaps) String() string + type Querier interface + Close func() error + LabelValues func(string) ([]string, error) + LabelValuesFor func(string, labels.Label) ([]string, error) + Select func(...labels.Matcher) (SeriesSet, error) + func NewBlockQuerier(b BlockReader, mint, maxt int64) (Querier, error) + type RecordDecoder struct + func (d *RecordDecoder) Samples(rec []byte, samples []RefSample) ([]RefSample, error) + func (d *RecordDecoder) Series(rec []byte, series []RefSeries) ([]RefSeries, error) + func (d *RecordDecoder) Tombstones(rec []byte, tstones []Stone) ([]Stone, error) + func (d *RecordDecoder) Type(rec []byte) RecordType + type RecordEncoder struct + func (e *RecordEncoder) Samples(samples []RefSample, b []byte) []byte + func (e *RecordEncoder) Series(series []RefSeries, b []byte) []byte + func (e *RecordEncoder) Tombstones(tstones []Stone, b []byte) []byte + type RecordType uint8 + const RecordInvalid + const RecordSamples + const RecordSeries + const RecordTombstones + type RefSample struct + Ref uint64 + T int64 + V float64 + type RefSeries struct + Labels labels.Labels + Ref uint64 + type SegmentWAL struct + func OpenSegmentWAL(dir string, logger log.Logger, flushInterval time.Duration, ...) (*SegmentWAL, error) + func (w *SegmentWAL) Close() error + func (w *SegmentWAL) LogDeletes(stones []Stone) error + func (w *SegmentWAL) LogSamples(samples []RefSample) error + func (w *SegmentWAL) LogSeries(series []RefSeries) error + func (w *SegmentWAL) Reader() WALReader + func (w *SegmentWAL) Sync() error + func (w *SegmentWAL) Truncate(mint int64, keep func(uint64) bool) error + type Series interface + Iterator func() SeriesIterator + Labels func() labels.Labels + type SeriesIterator interface + At func() (t int64, v float64) + Err func() error + Next func() bool + Seek func(t int64) bool + type SeriesSet interface + At func() Series + Err func() error + Next func() bool + func EmptySeriesSet() SeriesSet + func NewMergedSeriesSet(a, b SeriesSet) SeriesSet + type Stone struct + type StringTuples interface + At func(i int) ([]string, error) + Len func() int + type TimeRange struct + Max int64 + Min int64 + type TombstoneReader interface + Close func() error + Get func(ref uint64) (Intervals, error) + Iter func(func(uint64, Intervals) error) error + Total func() uint64 + type WAL interface + Close func() error + LogDeletes func([]Stone) error + LogSamples func([]RefSample) error + LogSeries func([]RefSeries) error + Reader func() WALReader + Truncate func(mint int64, keep func(uint64) bool) error + func NopWAL() WAL + type WALEntryType uint8 + const WALEntryDeletes + const WALEntrySamples + const WALEntrySeries + const WALEntrySymbols + type WALReader interface + Read func(seriesf func([]RefSeries), samplesf func([]RefSample), deletesf func([]Stone)) error