merger

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataPoint

type DataPoint[Self any] interface {
	pmetric.NumberDataPoint | pmetric.SummaryDataPoint | pmetric.HistogramDataPoint | pmetric.ExponentialHistogramDataPoint

	Timestamp() pcommon.Timestamp
	SetTimestamp(pcommon.Timestamp)
	Attributes() pcommon.Map
	CopyTo(dest Self)
}

type DataPointSlice

type DataPointSlice[DP DataPoint[DP]] interface {
	Len() int
	At(i int) DP
	AppendEmpty() DP
}

type Key

type Key struct {
	Interval       time.Duration
	ProcessingTime time.Time
}

TODO (lahsivjar): Think about multitenancy, should be part of the key

func NewKey

func NewKey(ivl time.Duration, pTime time.Time) Key

NewKey creates a new instance of the merger key.

func (*Key) Marshal

func (k *Key) Marshal() ([]byte, error)

Marshal marshals the key into binary representation.

func (*Key) SizeBinary

func (k *Key) SizeBinary() int

SizeBinary returns the size of the Key when binary encoded. The interval, represented by time.Duration, is encoded to 2 bytes by converting it into seconds. This allows a max of ~18 hours duration.

func (*Key) Unmarshal

func (k *Key) Unmarshal(d []byte) error

Unmarshal unmarshals the binary representation of the Key.

type Merger

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

func New

func New(v Value) *Merger

func (*Merger) Finish

func (m *Merger) Finish(includesBase bool) ([]byte, io.Closer, error)

func (*Merger) MergeNewer

func (m *Merger) MergeNewer(value []byte) error

func (*Merger) MergeOlder

func (m *Merger) MergeOlder(value []byte) error

type Value

type Value struct {
	Metrics pmetric.Metrics
	// contains filtered or unexported fields
}

Not safe for concurrent use.

func (*Value) MarshalProto

func (v *Value) MarshalProto() ([]byte, error)

func (*Value) Merge

func (v *Value) Merge(op Value) error

func (*Value) MergeMetric

func (v *Value) MergeMetric(
	rm pmetric.ResourceMetrics,
	sm pmetric.ScopeMetrics,
	m pmetric.Metric,
)

func (*Value) SizeBinary

func (v *Value) SizeBinary() int

func (*Value) UnmarshalProto

func (v *Value) UnmarshalProto(data []byte) (err error)

Jump to

Keyboard shortcuts

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