Documentation
¶
Overview ¶
Package aggregation implements aggregation functions to statistic a range of values.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromFieldValue ¶ added in v0.3.0
func FromFieldValue[N Number](fieldValue *modelv1.FieldValue) (N, error)
FromFieldValue transforms modelv1.FieldValue to Number.
func PartialToFieldValues ¶ added in v0.10.0
func PartialToFieldValues[N Number](af modelv1.AggregationFunction, p Partial[N]) ([]*modelv1.FieldValue, error)
PartialToFieldValues converts a Partial to field values for wire transport. For MEAN it returns two values (Value/sum first, Count second); for others one value.
func ToFieldValue ¶ added in v0.3.0
func ToFieldValue[N Number](value N) (*modelv1.FieldValue, error)
ToFieldValue transforms Number to modelv1.FieldValue.
Types ¶
type Map ¶ added in v0.10.0
Map accumulates raw values and produces aggregation results. It serves as the local accumulator for raw data points.
type Partial ¶ added in v0.10.0
type Partial[N Number] struct { Value N Count N }
Partial represents the intermediate result of a Map phase. For most functions only Value is meaningful; for MEAN both Value (sum) and Count are used.
func FieldValuesToPartial ¶ added in v0.10.0
func FieldValuesToPartial[N Number](af modelv1.AggregationFunction, fvs []*modelv1.FieldValue) (Partial[N], error)
FieldValuesToPartial converts field values from wire transport to a Partial. For MEAN expects two values (sum, count); for others one value (Count will be zero).