ts

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2022 License: Apache-2.0 Imports: 6 Imported by: 50

Documentation

Index

Constants

View Source
const OptimizedAnnotationLen = 16

OptimizedAnnotationLen specifies the limit of length of annotations for which we avoid allocations by using fixed backing memory where possible.

Variables

This section is empty.

Functions

This section is empty.

Types

type Annotation

type Annotation []byte

Annotation represents information used to annotate datapoints.

type Datapoint

type Datapoint struct {
	TimestampNanos xtime.UnixNano
	Value          float64
}

A Datapoint is a single data value reported at a given time.

func (Datapoint) Equal

func (d Datapoint) Equal(x Datapoint) bool

Equal returns whether one Datapoint is equal to another

type EncodedTags added in v0.11.0

type EncodedTags []byte

EncodedTags represents the encoded tags for the series.

type Segment

type Segment struct {
	// Head is the head of the segment.
	Head checked.Bytes
	// Tail is the tail of the segment.
	Tail checked.Bytes
	// SegmentFlags declares whether to finalize when finalizing the segment.
	Flags SegmentFlags
	// contains filtered or unexported fields
}

Segment represents a binary blob consisting of two byte slices and declares whether they should be finalized when the segment is finalized.

func NewSegment

func NewSegment(
	head, tail checked.Bytes,
	checksum uint32,
	flags SegmentFlags,
) Segment

NewSegment will create a new segment and increment the refs to head and tail if they are non-nil. When finalized the segment will also finalize the byte slices if FinalizeBytes is passed.

func (*Segment) CalculateChecksum added in v0.15.0

func (s *Segment) CalculateChecksum() uint32

CalculateChecksum calculates and sets the 32-bit checksum for this segment avoiding any allocations.

func (*Segment) Clone added in v0.6.0

func (s *Segment) Clone(pool pool.CheckedBytesPool) Segment

Clone will create a copy of this segment with an optional bytes pool.

func (*Segment) Equal

func (s *Segment) Equal(other *Segment) bool

Equal returns if this segment is equal to another. WARNING: This should only be used in code paths not executed often as it allocates bytes to concat each segment head and tail together before comparing the contents.

func (*Segment) Finalize

func (s *Segment) Finalize()

Finalize will finalize the segment by decrementing refs to head and tail if they are non-nil.

func (*Segment) Len

func (s *Segment) Len() int

Len returns the length of the head and tail.

type SegmentFlags

type SegmentFlags uint8

SegmentFlags describes the option to finalize or not finalize bytes in a Segment.

const (
	// FinalizeNone specifies to finalize neither of the bytes
	FinalizeNone SegmentFlags = 1 << 0
	// FinalizeHead specifies to finalize the head bytes
	FinalizeHead SegmentFlags = 1 << 1
	// FinalizeTail specifies to finalize the tail bytes
	FinalizeTail SegmentFlags = 1 << 2
)

type Series added in v0.4.8

type Series struct {
	// UniqueIndex is the unique index assigned to this series (only valid
	// on a per-process basis).
	UniqueIndex uint64

	// Namespace is the namespace the series belongs to.
	Namespace ident.ID

	// ID is the series identifier.
	ID ident.ID

	// EncodedTags are the series encoded tags, if set then call sites can
	// avoid needing to encoded the tags from the series tags provided.
	EncodedTags EncodedTags

	// Shard is the shard the series belongs to.
	Shard uint32
}

Series describes a series.

Directories

Path Synopsis
Package writes is a generated GoMock package.
Package writes is a generated GoMock package.

Jump to

Keyboard shortcuts

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