aggregation

package
v0.0.0-...-1329d2c Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccumulatingGroup

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

func NewAccumulatingGroup

func NewAccumulatingGroup(compiler *expressions.KeyBuilder) *AccumulatingGroup

func (*AccumulatingGroup) AddDataExpr

func (s *AccumulatingGroup) AddDataExpr(name, expr, initial string) error

func (*AccumulatingGroup) AddGroupExpr

func (s *AccumulatingGroup) AddGroupExpr(name, expr string) error

func (*AccumulatingGroup) ColCount

func (s *AccumulatingGroup) ColCount() int

Total columns (group + data)

func (*AccumulatingGroup) Data

func (s *AccumulatingGroup) Data(groupKey GroupKey) []string

Returns a new slice of data-groups for key

func (*AccumulatingGroup) DataColCount

func (s *AccumulatingGroup) DataColCount() int

func (*AccumulatingGroup) DataColIdx

func (s *AccumulatingGroup) DataColIdx(name string) (idx int, ok bool)

Gets index of a data column by name

func (*AccumulatingGroup) DataCols

func (s *AccumulatingGroup) DataCols() []string

func (*AccumulatingGroup) DataCount

func (s *AccumulatingGroup) DataCount() int

func (*AccumulatingGroup) DataNoCopy

func (s *AccumulatingGroup) DataNoCopy(groupKey GroupKey) []string

func (*AccumulatingGroup) GroupColCount

func (s *AccumulatingGroup) GroupColCount() int

Number of defined group columns

func (*AccumulatingGroup) GroupCols

func (s *AccumulatingGroup) GroupCols() []string

func (*AccumulatingGroup) Groups

func (s *AccumulatingGroup) Groups(sort sorting.NameSorter) []GroupKey

All possible values that were found for groups (as GroupKey) as a new slice

func (*AccumulatingGroup) ParseErrors

func (s *AccumulatingGroup) ParseErrors() uint64

func (*AccumulatingGroup) Sample

func (s *AccumulatingGroup) Sample(element string)

func (*AccumulatingGroup) SetSort

func (s *AccumulatingGroup) SetSort(expr string) error

type Aggregator

type Aggregator interface {
	Sample(element string)
	ParseErrors() uint64
}

Aggregator provides default agg interface

type GroupKey

type GroupKey string

func (GroupKey) Parts

func (s GroupKey) Parts() []string

Split a group key into its individual parts

type MatchCounter

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

func NewCounter

func NewCounter() *MatchCounter

func (*MatchCounter) GroupCount

func (s *MatchCounter) GroupCount() int

func (*MatchCounter) Items

func (s *MatchCounter) Items() []MatchPair

func (*MatchCounter) ItemsSortedBy

func (s *MatchCounter) ItemsSortedBy(count int, sorter sorting.NameValueSorter) []MatchPair

func (*MatchCounter) ParseErrors

func (s *MatchCounter) ParseErrors() uint64

func (*MatchCounter) Sample

func (s *MatchCounter) Sample(element string)

func (*MatchCounter) SampleValue

func (s *MatchCounter) SampleValue(element string, count int64)

func (*MatchCounter) Total

func (s *MatchCounter) Total() int64

type MatchItem

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

func (*MatchItem) Count

func (s *MatchItem) Count() int64

type MatchNumerical

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

func NewNumericalAggregator

func NewNumericalAggregator(config *NumericalConfig) *MatchNumerical

func (*MatchNumerical) Analyze

func (s *MatchNumerical) Analyze() *StatisticalAnalysis

func (*MatchNumerical) Count

func (s *MatchNumerical) Count() uint64

func (*MatchNumerical) Max

func (s *MatchNumerical) Max() float64

func (*MatchNumerical) Mean

func (s *MatchNumerical) Mean() float64

func (*MatchNumerical) Min

func (s *MatchNumerical) Min() float64

func (*MatchNumerical) ParseErrors

func (s *MatchNumerical) ParseErrors() uint64

func (*MatchNumerical) Sample

func (s *MatchNumerical) Sample(element string)

func (*MatchNumerical) Samplef

func (s *MatchNumerical) Samplef(val float64)

func (*MatchNumerical) StdDev

func (s *MatchNumerical) StdDev() float64

func (*MatchNumerical) Variance

func (s *MatchNumerical) Variance() float64

type MatchPair

type MatchPair struct {
	Item MatchItem
	Name string
}

type NumericalConfig

type NumericalConfig struct {
	Reverse               bool // When sorting values for analysis, sort in reverse
	KeepValuesForAnalysis bool // Keep values for more numerical analysis (mode, quantiles, etc)
}

type StatisticalAnalysis

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

func (*StatisticalAnalysis) Median

func (s *StatisticalAnalysis) Median() float64

func (*StatisticalAnalysis) Mode

func (s *StatisticalAnalysis) Mode() float64

func (*StatisticalAnalysis) Quantile

func (s *StatisticalAnalysis) Quantile(p float64) float64

type SubKeyCounter

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

func NewSubKeyCounter

func NewSubKeyCounter() *SubKeyCounter

func (*SubKeyCounter) Items

func (s *SubKeyCounter) Items() []SubKeyNamedItem

func (*SubKeyCounter) ItemsSorted

func (s *SubKeyCounter) ItemsSorted(sorter sorting.NameValueSorter) []SubKeyNamedItem

func (*SubKeyCounter) ParseErrors

func (s *SubKeyCounter) ParseErrors() uint64

func (*SubKeyCounter) Sample

func (s *SubKeyCounter) Sample(element string)

func (*SubKeyCounter) SampleValue

func (s *SubKeyCounter) SampleValue(key, subkey string, count int64)

func (*SubKeyCounter) SubKeys

func (s *SubKeyCounter) SubKeys() []string

type SubKeyItem

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

func (*SubKeyItem) Count

func (s *SubKeyItem) Count() int64

func (*SubKeyItem) Items

func (s *SubKeyItem) Items() []int64

type SubKeyNamedItem

type SubKeyNamedItem struct {
	Item SubKeyItem
	Name string
}

SubKeyNamedItem is a returnable key-pair for data aggregation

type TableAggregator

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

func NewTable

func NewTable(delim string) *TableAggregator

func (*TableAggregator) ColTotal

func (s *TableAggregator) ColTotal(k string) int64

ColTotals returns column oriented totals (Do not change!)

func (*TableAggregator) ColumnCount

func (s *TableAggregator) ColumnCount() int

func (*TableAggregator) Columns

func (s *TableAggregator) Columns() []string

func (*TableAggregator) ComputeMinMax

func (s *TableAggregator) ComputeMinMax() (min, max int64)

func (*TableAggregator) OrderedColumns

func (s *TableAggregator) OrderedColumns(sorter sorting.NameValueSorter) []string

func (*TableAggregator) OrderedRows

func (s *TableAggregator) OrderedRows(sorter sorting.NameValueSorter) []*TableRow

func (*TableAggregator) ParseErrors

func (s *TableAggregator) ParseErrors() uint64

func (*TableAggregator) RowCount

func (s *TableAggregator) RowCount() int

func (*TableAggregator) Rows

func (s *TableAggregator) Rows() []*TableRow

func (*TableAggregator) Sample

func (s *TableAggregator) Sample(ele string)

Samples item like "<column><delim><row><delim><count>"

func (*TableAggregator) SampleItem

func (s *TableAggregator) SampleItem(colKey, rowKey string, inc int64)

func (*TableAggregator) Sum

func (s *TableAggregator) Sum() (ret int64)

Sum all data

func (*TableAggregator) Trim

func (s *TableAggregator) Trim(predicate func(col, row string, val int64) bool) int

Trim data. Returns number of fields trimmed

type TableRow

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

func (*TableRow) Name

func (s *TableRow) Name() string

func (*TableRow) Sum

func (s *TableRow) Sum() int64

Sum is the total sum of all values in the row

func (*TableRow) Value

func (s *TableRow) Value(colKey string) int64

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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