streams

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Aggregate

func Aggregate[D data.Point[D]](m metrics.Data[D], aggr Aggregator[D]) error

Aggregate each point and replace it by the result

func AtLimit added in v0.97.0

func AtLimit(err error) bool

func Error

func Error(id Ident, err error) error

Types

type Aggregator

type Aggregator[D data.Point[D]] interface {
	Aggregate(Ident, D) (D, error)
}

type ErrEvicted added in v0.97.0

type ErrEvicted struct {
	ErrLimit
	Ident Ident
}

func (ErrEvicted) Error added in v0.97.0

func (e ErrEvicted) Error() string

type ErrLimit added in v0.97.0

type ErrLimit int

func (ErrLimit) Error added in v0.97.0

func (e ErrLimit) Error() string

type Evictor added in v0.97.0

type Evictor = streams.Evictor

type Ident

type Ident = identity.Stream

type LimitMap added in v0.97.0

type LimitMap[T any] struct {
	Max int

	Evictor streams.Evictor
	streams.Map[T]
}

func Limit added in v0.97.0

func Limit[T any](m Map[T], max int) LimitMap[T]

func (LimitMap[T]) Store added in v0.97.0

func (m LimitMap[T]) Store(id identity.Stream, v T) error

type Map added in v0.97.0

type Map[T any] streams.Map[T]

type MapAggr added in v0.97.0

type MapAggr[D data.Point[D]] struct {
	Map[D]
}

func IntoAggregator added in v0.97.0

func IntoAggregator[D data.Point[D]](m Map[D]) MapAggr[D]

func (MapAggr[D]) Aggregate added in v0.97.0

func (a MapAggr[D]) Aggregate(id Ident, dp D) (D, error)

type Seq added in v0.97.0

type Seq[T any] streams.Seq[T]

func Samples

func Samples[D data.Point[D]](m metrics.Data[D]) Seq[D]

Samples returns an Iterator over each sample of all streams in the metric

type StreamErr

type StreamErr struct {
	Ident Ident
	Err   error
}

func (StreamErr) Error

func (e StreamErr) Error() string

Jump to

Keyboard shortcuts

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