series

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package series is the series-identity index: it maps a content-addressed signal.SeriesID to its full identity (signal.Series — Resource + Scope + data-point attributes) and back. Adding a series is idempotent (the id is the hash of the identity), so the same series ingested twice — or replayed from the WAL — resolves to one entry. The stored identity lets a query reconstruct a series' labels from an id.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Index

type Index struct {
	// contains filtered or unexported fields
}

Index maps signal.SeriesIDsignal.Series. The zero value is not usable; create one with New. Not safe for concurrent use; callers own synchronization.

func New

func New() *Index

New returns an empty Index.

func (*Index) Add

func (ix *Index) Add(s signal.Series) signal.SeriesID

Add interns a series identity and returns its signal.SeriesID. It is idempotent: re-adding an equal identity returns the same id without storing a second copy. The identity's byte payloads are interned (not cloned) and its resource/scope sets are deduplicated, so the caller may reuse its buffers and each distinct string — and each distinct resource/scope — is stored once across the whole index.

func (*Index) ForEach

func (ix *Index) ForEach(fn func(id signal.SeriesID, s signal.Series))

ForEach calls fn for each (id, identity) pair. Iteration order is unspecified.

func (*Index) Get

func (ix *Index) Get(id signal.SeriesID) (signal.Series, bool)

Get returns the identity for id and whether it is known.

func (*Index) Has

func (ix *Index) Has(id signal.SeriesID) bool

Has reports whether id is known.

func (*Index) Len

func (ix *Index) Len() int

Len returns the number of distinct series.

Jump to

Keyboard shortcuts

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