# README
TSDB
This repository contains the Prometheus storage layer that is used in its 2.x releases.
A writeup of its design can be found here.
Based on the Gorilla TSDB white papers.
Video: Storing 16 Bytes at Scale from PromCon 2017.
See also the format documentation.
# 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 suported by the tsdb module.
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
No description provided by the author
# Functions
Checkpoint creates a compacted checkpoint of segments in range [first, last] in the given WAL.
DeleteCheckpoints deletes all checkpoints in a directory below a given index.
EmptySeriesSet returns a series set that's always empty.
ExponentialBlockRanges returns the time ranges based on the stepSize.
LastCheckpoint returns the directory name and index of the most recent checkpoint.
LookupChunkSeries retrieves all series for the given matchers and returns a ChunkSeriesSet over them.
MigrateWAL rewrites the deprecated write ahead log into the new format.
NewBlockQuerier returns a querier against the reader.
NewHead opens the head block in dir.
NewLeveledCompactor returns a LeveledCompactor.
NewMergedSeriesSet takes two series sets as a single series set.
NewMergedVerticalSeriesSet takes two series sets as a single series set.
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.
OpenSegmentWAL opens or creates a write ahead log in the given directory.
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
MagicTombstone is 4 bytes at the head of a tombstone file.
RecordInvalid is returned for unrecognised WAL record types.
RecordSamples is used to match WAL records of type Samples.
RecordSeries is used to match WAL records of type Series.
RecordTombstones is used to match WAL records of type Tombstones.
Entry types in a segment file.
Entry types in a segment file.
Entry types in a segment file.
Entry types in a segment file.
WALFormatDefault is the version flag for the default outer segment file format.
WALMagic is a 4 byte number every WAL segment file starts with.
# Variables
DefaultOptions used for the DB.
ErrAmendSample is returned if an appended sample has the same timestamp as the most recent sample but a different value.
ErrClosed is returned when the db is closed.
ErrClosing is returned when a block is in the process of being closed.
ErrNotFound is returned if a looked up resource was not found.
ErrOutOfBounds is returned if an appended sample is out of the writable time range.
ErrOutOfOrderSample is returned if an appended sample has a timestamp smaller than the most recent sample.
# 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.
CheckpointStats returns stats about a created checkpoint.
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.
Head handles reads and writes of time series data within a time window.
Interval represents a single time-interval.
LeveledCompactor implements the Compactor interface.
Options of the DB storage.
RecordDecoder decodes series, sample, and tombstone records.
RecordEncoder encodes series, sample, and tombstones records.
RefSample is a timestamp/value pair associated with a reference to a series.
RefSeries is the series labels with the series ID.
SegmentWAL is a write ahead log for series data.
Stone holds the information on the posting and time-range that is deleted.
TimeRange specifies minTime and maxTime range.
# Interfaces
Appendable defines an entity to which data can be appended.
Appender allows appending a batch of data.
BlockReader provides reading access to a data block.
ChunkReader provides reading access of serialized time series data.
ChunkSeriesSet exposes the chunks and intervals of a series instead of the actual series itself.
ChunkWriter serializes a time block of chunked series data.
Compactor provides compaction against an underlying storage of time series data.
IndexReader provides reading access of serialized index data.
IndexWriter serializes the index for a block of series data.
Querier provides querying access over time series data of a fixed time range.
Series exposes a single time series.
SeriesIterator iterates over the data of a time series.
SeriesSet contains a set of series.
StringTuples provides access to a sorted list of string tuples.
TombstoneReader gives access to tombstone intervals by series reference.
WAL is a write ahead log that can log new series labels and samples.
WALReader reads entries from a WAL.
# Type aliases
Intervals represents a set of increasing and non-overlapping time-intervals.
Overlaps contains overlapping blocks aggregated by overlapping range.
RecordType represents the data type of a record.
WALEntryType indicates what data a WAL entry contains.