consolidations

package
v0.17.0-patch2 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2024 License: BSD-2-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AvailableSummarizers = []string{"sum", "total", "avg", "average", "avg_zero", "max", "min", "last", "current", "first", "range", "rangeOf", "median", "multiply", "diff", "count", "stddev"}
View Source
var ConsolidationToFunc = map[string]func([]float64) float64{
	"average":  AggMean,
	"avg_zero": AggMeanZero,
	"avg":      AggMean,
	"count":    AggCount,
	"diff":     AggDiff,
	"max":      AggMax,
	"maximum":  AggMax,
	"median":   summarizeToAggregate("median"),
	"min":      AggMin,
	"minimum":  AggMin,
	"multiply": summarizeToAggregate("multiply"),
	"range":    summarizeToAggregate("range"),
	"rangeOf":  summarizeToAggregate("rangeOf"),
	"sum":      AggSum,
	"total":    AggSum,
	"stddev":   summarizeToAggregate("stddev"),
	"first":    AggFirst,
	"last":     AggLast,
	"current":  AggLast,
}

ConsolidationToFunc contains a map of graphite-compatible consolidation functions definitions to actual functions that can do aggregation TODO(civil): take into account xFilesFactor

View Source
var ErrInvalidConsolidationFunc = merry.New("Invalid Consolidation Function")

Functions

func AggCount

func AggCount(v []float64) float64

AggCount counts non-NaN points

func AggDiff

func AggDiff(v []float64) float64

func AggFirst

func AggFirst(v []float64) float64

AggFirst returns first point

func AggLast

func AggLast(v []float64) float64

AggLast returns last point

func AggMax

func AggMax(v []float64) float64

AggMax computes max of values

func AggMean

func AggMean(v []float64) float64

AggMean computes mean (sum(v)/len(v), excluding NaN points) of values

func AggMeanZero

func AggMeanZero(v []float64) float64

AggMeanZero computes mean (sum(v)/len(v), replacing NaN points with 0

func AggMin

func AggMin(v []float64) float64

AggMin computes min of values

func AggSum

func AggSum(v []float64) float64

AggSum computes sum of values

func AvailableConsolidationFuncs

func AvailableConsolidationFuncs() []string

AvailableConsolidationFuncs lists all available consolidation functions

func AvgValue

func AvgValue(f64s []float64) float64

AvgValue returns average of list of values

func CheckValidConsolidationFunc added in v0.16.0

func CheckValidConsolidationFunc(functionName string) error

func CurrentValue

func CurrentValue(f64s []float64) float64

CurrentValue returns last non-absent value (if any), otherwise returns NaN

func MaxValue

func MaxValue(f64s []float64) float64

MaxValue returns maximum from the list

func MinValue

func MinValue(f64s []float64) float64

MinValue returns minimal from the list

func Percentile

func Percentile(data []float64, percent float64, interpolate bool) float64

Percentile returns percent-th percentile. Can interpolate if needed

func Poly

func Poly(x float64, coeffs ...float64) float64

Poly computes polynom with specified coefficients

func SummarizeValues

func SummarizeValues(f string, values []float64, XFilesFactor float32) float64

SummarizeValues summarizes values

func Vandermonde

func Vandermonde(absent []float64, deg int) *mat.Dense

Vandermonde creates a Vandermonde matrix

func VarianceValue

func VarianceValue(f64s []float64) float64

VarianceValue gets variances of list of values

Types

This section is empty.

Jump to

Keyboard shortcuts

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