tem

package
v0.0.0-...-dc2a067 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultCacheSnapshotMemorySize = 25 * 1024 * 1024 // 25MB

)

Variables

View Source
var ErrClosing = errors.New("block is closing")

Functions

func NewBlochawkobserveer

func NewBlochawkobserveer(b BlockReader) *blockSearcher

func TraceAll

func TraceAll()

Types

type Block

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

func (*Block) Close

func (b *Block) Close() error

func (*Block) Index

func (b *Block) Index() IndexReader

func (*Block) LastSegNum

func (b *Block) LastSegNum() uint64

func (*Block) LogNum

func (b *Block) LogNum() uint64

func (*Block) Logs

func (b *Block) Logs() LogReader

func (*Block) MaxTime

func (b *Block) MaxTime() int64

func (*Block) MinTime

func (b *Block) MinTime() int64

func (*Block) ReadDone

func (b *Block) ReadDone()

type BlockControl

type BlockControl interface {
	ReadDone()
}

type BlockMeta

type BlockMeta struct {
	// Unique identifier for the block and its contents. Changes on compaction.
	ULID ulid.ULID `json:"ulid"`

	// MinTime and MaxTime specify the time range all samples
	// in the block are in.
	MinTime int64 `json:"minTime"`
	MaxTime int64 `json:"maxTime"`

	LogID            []uint64 `json:"log_id"`
	Total            uint64   `json:"total"`
	SkipListLevel    int      `json:"skiplistlevel"`
	SkipListInterval int      `json:"SkipListInterval"`

	Compaction BlockMetaCompaction `json:"compaction"`
}

type BlockMetaCompaction

type BlockMetaCompaction struct {
	// Maximum number of compaction cycles any source block has
	// gone through.
	Level int `json:"level"`
	// ULIDs of all source head blocks that went into the block.
	Parents []ulid.ULID `json:"parents,omitempty"`
}

BlockMetaCompaction holds information about compactions a block went through.

type BlockReader

type BlockReader interface {
	Index() IndexReader

	Logs() LogReader

	MinTime() int64

	MaxTime() int64

	LogNum() uint64

	LastSegNum() uint64
}

type ChunkSeriesSet

type ChunkSeriesSet interface {
	Next() bool
	At() (labels.Labels, [][]chunks.Chunk)
	Err() error
}

type Engine

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

func NewEngine

func NewEngine(opt *Options, a *analysis.Analyzer) (*Engine, error)

func (*Engine) Index

func (e *Engine) Index(compressed []byte) error

func (*Engine) Searcher

func (e *Engine) Searcher(mint, maxt int64) (Searcher, error)

func (*Engine) ShouldCompactMem

func (e *Engine) ShouldCompactMem(h *Head) bool
type Head struct {
	MaxT int64
	// contains filtered or unexported fields
}

func NewHead

func NewHead(alloc byteutil.Allocator, chunkRange int64, a *analysis.Analyzer, skiplistLevel, skipListInterval int, msgTagName string) *Head

func (*Head) Close

func (h *Head) Close()

func (*Head) Index

func (h *Head) Index() IndexReader

func (*Head) LastSegNum

func (h *Head) LastSegNum() uint64

func (*Head) LogNum

func (h *Head) LogNum() uint64

func (*Head) Logs

func (h *Head) Logs() LogReader

func (*Head) MaxTime

func (h *Head) MaxTime() int64

func (*Head) MinTime

func (h *Head) MinTime() int64

func (*Head) ReadDone

func (h *Head) ReadDone()

type IndexReader

type IndexReader interface {
	MaxDoc() float64
	Search(lset []*prompb.LabelMatcher, expr temql.Expr) (posting.Postings, []series.Series)
	ChunkReader() chunks.ChunkReader
	Iterator() disk.IteratorLabel
	Close() error
}

type LogReader

type LogReader interface {
	ReadLog(uint64) []byte
	Iterator() disk.LogIterator
	Close() error
}

type MultiError

type MultiError []error

The MultiError type implements the error interface, and contains the Errors used to construct it.

func (*MultiError) Add

func (es *MultiError) Add(err error)

Add adds the error to the error list if it is not nil.

func (MultiError) Err

func (es MultiError) Err() error

Err returns the error list as an error or nil if it is empty.

func (MultiError) Error

func (es MultiError) Error() string

Returns a concatenated string of the contained errors

type Options

type Options struct {
	RetentionDuration uint64

	BlockRanges []int64

	DataDir string

	MaxBlockDuration int64

	FlushWritecoldDuration int64

	DefaultCacheSnapshotMemorySize int

	SkipListInterval int

	SkipListLevel int

	UseSkipList bool

	MsgTagName string
}

type Searcher

type Searcher interface {
	Search(lset []*prompb.LabelMatcher, expr temql.Expr, mint, maxt int64) SeriesSet
	Close() error
}

type Serices

type Serices interface {
}

type Series

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 exposes a single time series.

type SeriesIterator

type SeriesIterator interface {
	At() (t int64, v uint64, pos []int, b []byte)
	// 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

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

SeriesSet contains a set of series.

func NewMergedSeriesSet

func NewMergedSeriesSet(a, b SeriesSet) SeriesSet

NewMergedSeriesSet takes two series sets as a single series set. The input series sets must be sorted and sequential in time, i.e. if they have the same label set, the datapoints of a must be before the datapoints of b.

type Wal

type Wal interface {
	// contains filtered or unexported methods
}

Directories

Path Synopsis
Package cache provides interface and implementation of a cache algorithms.
Package cache provides interface and implementation of a cache algorithms.
rax

Jump to

Keyboard shortcuts

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