import "github.com/prometheus/tsdb/chunks"
const ( // MagicChunks is 4 bytes at the head of a series file. MagicChunks = 0x85BD40DD // MagicChunksSize is the size in bytes of MagicChunks. MagicChunksSize = 4 ChunksFormatVersionSize = 1 )
MergeChunks vertically merges a and b, i.e., if there is any sample with same timestamp in both a and b, the sample in a is discarded.
ByteSlice abstracts a byte slice.
type Meta struct { // Ref and Chunk hold either a reference that can be used to retrieve // chunk data or the data itself. // Generally, only one of them is set. Ref uint64 Chunk chunkenc.Chunk // Time range the data covers. // When MaxTime == math.MaxInt64 the chunk is still open and being appended to. MinTime, MaxTime int64 }
Meta holds information about a chunk of data.
MergeOverlappingChunks removes the samples whose timestamp is overlapping. The last appearing sample is retained in case there is overlapping. This assumes that `chks []Meta` is sorted w.r.t. MinTime.
OverlapsClosedInterval Returns true if the chunk overlaps [mint, maxt].
type Reader struct {
// contains filtered or unexported fields
}
Reader implements a ChunkReader for a serialized byte stream of series data.
NewDirReader returns a new Reader against sequentially numbered files in the given directory.
Chunk returns a chunk from a given reference.
Size returns the size of the chunks.
type Writer struct {
// contains filtered or unexported fields
}
Writer implements the ChunkWriter interface for the standard serialization format.
NewWriter returns a new writer against the given directory.
Package chunks imports 14 packages (graph) and is imported by 17 packages. Updated 2019-08-04. Refresh now. Tools for package owners.