Documentation ¶
Overview ¶
Package record contains the various record types used for encoding various Head block data in the WAL and in-memory snapshot.
Index ¶
- Variables
- type Decoder
- func (d *Decoder) Exemplars(rec []byte, exemplars []RefExemplar) ([]RefExemplar, error)
- func (d *Decoder) ExemplarsFromBuffer(dec *encoding.Decbuf, exemplars []RefExemplar) ([]RefExemplar, error)
- func (d *Decoder) Samples(rec []byte, samples []RefSample) ([]RefSample, error)
- func (d *Decoder) Series(rec []byte, series []RefSeries) ([]RefSeries, error)
- func (d *Decoder) Tombstones(rec []byte, tstones []tombstones.Stone) ([]tombstones.Stone, error)
- func (d *Decoder) Type(rec []byte) Type
- type Encoder
- func (e *Encoder) EncodeExemplarsIntoBuffer(exemplars []RefExemplar, buf *encoding.Encbuf)
- func (e *Encoder) Exemplars(exemplars []RefExemplar, b []byte) []byte
- func (e *Encoder) Samples(samples []RefSample, b []byte) []byte
- func (e *Encoder) Series(series []RefSeries, b []byte) []byte
- func (e *Encoder) Tombstones(tstones []tombstones.Stone, b []byte) []byte
- type RefExemplar
- type RefSample
- type RefSeries
- type Type
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrNotFound is returned if a looked up resource was not found. Duplicate ErrNotFound from head.go.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder struct{}
Decoder decodes series, sample, and tombstone records. The zero value is ready to use.
func (*Decoder) Exemplars ¶
func (d *Decoder) Exemplars(rec []byte, exemplars []RefExemplar) ([]RefExemplar, error)
func (*Decoder) ExemplarsFromBuffer ¶
func (d *Decoder) ExemplarsFromBuffer(dec *encoding.Decbuf, exemplars []RefExemplar) ([]RefExemplar, error)
func (*Decoder) Tombstones ¶
func (d *Decoder) Tombstones(rec []byte, tstones []tombstones.Stone) ([]tombstones.Stone, error)
Tombstones appends tombstones in rec to the given slice.
type Encoder ¶
type Encoder struct{}
Encoder encodes series, sample, and tombstones records. The zero value is ready to use.
func (*Encoder) EncodeExemplarsIntoBuffer ¶
func (e *Encoder) EncodeExemplarsIntoBuffer(exemplars []RefExemplar, buf *encoding.Encbuf)
func (*Encoder) Tombstones ¶
func (e *Encoder) Tombstones(tstones []tombstones.Stone, b []byte) []byte
Tombstones appends the encoded tombstones to b and returns the resulting slice.
type RefExemplar ¶
RefExemplar is an exemplar with it's labels, timestamp, value the exemplar was collected/observed with, and a reference to a series.
type RefSample ¶
type RefSample struct { Ref chunks.HeadSeriesRef T int64 V float64 }
RefSample is a timestamp/value pair associated with a reference to a series.
type RefSeries ¶
type RefSeries struct { Ref chunks.HeadSeriesRef Labels labels.Labels }
RefSeries is the series labels with the series ID.
type Type ¶
type Type uint8
Type represents the data type of a record.
const ( // Unknown is returned for unrecognised WAL record types. Unknown Type = 255 // Series is used to match WAL records of type Series. Series Type = 1 // Samples is used to match WAL records of type Samples. Samples Type = 2 // Tombstones is used to match WAL records of type Tombstones. Tombstones Type = 3 // Exemplars is used to match WAL records of type Exemplars. Exemplars Type = 4 )