package
0.0.0-20241031191629-03ae564a171d
Repository: https://github.com/zzylol/prometheus-sketches.git
Documentation: pkg.go.dev

# README

TSDB

GoPkg

This directory contains the Prometheus TSDB (Time Series DataBase) library, which handles storage and querying of all Prometheus v2 data.

Documentation

External resources

A series of blog posts explaining different components of TSDB:

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
Package fileutil provides utility methods used when dealing with the filesystem in tsdb.
Package goversion enforces the go version supported by the tsdb module.
No description provided by the author
Package record contains the various record types used for encoding various Head block data in the WAL and in-memory snapshot.
No description provided by the author
No description provided by the author
No description provided by the author

# Functions

BeyondSizeRetention returns those blocks which are beyond the size retention set in the db options.
BeyondTimeRetention returns those blocks which are beyond the time retention set in the db options.
CompactBlockMetas merges many block metas into one, combining it's source blocks together and adjusting compaction level.
CreateBlock creates a chunkrange block from the samples passed to it, and writes it to disk.
DefaultBlocksToDelete returns a filter which decides time based and size based retention from the options of the db.
No description provided by the author
DefaultOptions used for the DB.
DeleteChunkSnapshots deletes all chunk snapshots in a directory below a given index.
ExponentialBlockRanges returns the time ranges based on the stepSize.
LastChunkSnapshot returns the directory name and index of the most recent chunk snapshot.
NewBlockChunkQuerier returns a chunk querier against the block reader and requested min and max time range.
No description provided by the author
NewBlockQuerier returns a querier against the block reader and requested min and max time range.
NewBlockWriter create a new block writer.
NewCircularExemplarStorage creates an circular in memory exemplar storage.
NewCompactorMetrics initializes metrics for Compactor.
NewDBStats returns a new DBStats object initialized using the new function from each component.
No description provided by the author
NewHead opens the head block in dir.
NewHeadStats returns a new HeadStats object.
No description provided by the author
No description provided by the author
No description provided by the author
NewMergedStringIter returns string iterator that allows to merge symbols on demand and stream result.
No description provided by the author
NewOOOCompactionHead does the following: 1.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NewRangeHead returns a *RangeHead.
NewRangeHeadWithIsolationDisabled returns a *RangeHead that does not create an isolationState.
Open returns a new DB in the given directory.
OpenBlock opens the block in the directory.
OpenDBReadOnly opens DB in the given directory for read only operations.
OverlappingBlocks returns all overlapping blocks from given meta files.
PostingsForMatchers assembles a single postings iterator against the index reader based on the given matchers.

# Constants

CompactionHintFromOutOfOrder is a hint noting that the block was created from out-of-order chunks.
Default duration of a block in milliseconds.
DefaultOutOfOrderCapMax is the default maximum size of an in-memory out-of-order chunk.
DefaultSamplesPerChunk provides a default target number of samples per chunk.
DefaultStripeSize is the default number of entries to allocate in the stripeSeries hash map.

# Variables

ErrAppenderClosed is returned if an appender has already be successfully rolled back or committed.
ErrClosed is returned when the db is closed.
ErrClosing is returned when a block is in the process of being closed.
ErrInvalidExemplar is returned if an appended exemplar is not valid and can't be ingested.
ErrInvalidSample is returned if an appended sample is not valid and can't be ingested.
No description provided by the author
ErrNoSeriesAppended is returned if the series count is zero while flushing blocks.
ErrNotReady is returned if the underlying storage is not ready yet.

# Structs

Block represents a directory of time series data covering a continuous time range.
BlockDesc describes a block by ULID and time range.
BlockMeta provides meta information about a block.
BlockMetaCompaction holds information about compactions a block went through.
BlockStats contains stats about contents of a block.
BlockWriter is a block writer that allows appending and flushing series to disk.
ChunkSnapshotStats returns stats about a created chunk snapshot.
No description provided by the author
No description provided by the author
DB handles reads and writes of time series falling into a hashed partition of a seriedb.
DBReadOnly provides APIs for read only operations on a database.
DBStats contains statistics about the DB separated by component (eg.
No description provided by the author
DeletedIterator wraps chunk Iterator and makes sure any deleted metrics are not returned.
No description provided by the author
Head handles reads and writes of time series data within a time window.
HeadOptions are parameters for the Head block.
HeadStats are the statistics for the head component of the DB.
LeveledCompactor implements the Compactor interface.
No description provided by the author
OOOChunk maintains samples in time-ascending order.
No description provided by the author
No description provided by the author
No description provided by the author
OOOHeadIndexReader implements IndexReader so ooo samples in the head can be accessed.
OOORangeHead allows querying Head out of order samples via BlockReader interface implementation.
Options of the DB storage.
RangeHead allows querying Head via an IndexReader, ChunkReader and tombstones.Reader but only within a restricted range.
No description provided by the author
TimeRange specifies minTime and maxTime range.
WALReplayStatus contains status information about the WAL replay.

# Interfaces

No description provided by the author
BlockReader provides reading access to a data block.
ChunkReader provides reading access of serialized time series data.
ChunkWriter serializes a time block of chunked series data.
Compactor provides compaction against an underlying storage of time series data.
No description provided by the author
IndexReader provides reading access of serialized index data.
IndexWriter serializes the index for a block of series data.
SeriesLifecycleCallback specifies a list of callbacks that will be called during a lifecycle of a series.

# Type aliases

No description provided by the author
Overlaps contains overlapping blocks aggregated by overlapping range.