aggregation

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: May 21, 2019 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Options
	// contains filtered or unexported fields
}

Counter aggregates counter values.

func NewCounter

func NewCounter(opts Options) Counter

NewCounter creates a new counter.

func (*Counter) Close

func (c *Counter) Close()

Close closes the counter.

func (*Counter) Count

func (c *Counter) Count() int64

Count returns the number of values received.

func (*Counter) Max

func (c *Counter) Max() int64

Max returns the maximum counter value.

func (*Counter) Mean

func (c *Counter) Mean() float64

Mean returns the mean counter value.

func (*Counter) Min

func (c *Counter) Min() int64

Min returns the minimum counter value.

func (*Counter) Stdev

func (c *Counter) Stdev() float64

Stdev returns the standard deviation counter value.

func (*Counter) Sum

func (c *Counter) Sum() int64

Sum returns the sum of counter values.

func (*Counter) SumSq

func (c *Counter) SumSq() int64

SumSq returns the squared sum of counter values.

func (*Counter) Update

func (c *Counter) Update(value int64)

Update updates the counter value.

func (*Counter) ValueOf

func (c *Counter) ValueOf(aggType aggregation.Type) float64

ValueOf returns the value for the aggregation type.

type Gauge

type Gauge struct {
	Options
	// contains filtered or unexported fields
}

Gauge aggregates gauge values.

func NewGauge

func NewGauge(opts Options) Gauge

NewGauge creates a new gauge.

func (*Gauge) Close

func (g *Gauge) Close()

Close closes the gauge.

func (*Gauge) Count

func (g *Gauge) Count() int64

Count returns the number of values received.

func (*Gauge) Last

func (g *Gauge) Last() float64

Last returns the last value received.

func (*Gauge) Max

func (g *Gauge) Max() float64

Max returns the maximum gauge value.

func (*Gauge) Mean

func (g *Gauge) Mean() float64

Mean returns the mean gauge value.

func (*Gauge) Min

func (g *Gauge) Min() float64

Min returns the minimum gauge value.

func (*Gauge) Stdev

func (g *Gauge) Stdev() float64

Stdev returns the standard deviation gauge value.

func (*Gauge) Sum

func (g *Gauge) Sum() float64

Sum returns the sum of gauge values.

func (*Gauge) SumSq

func (g *Gauge) SumSq() float64

SumSq returns the squared sum of gauge values.

func (*Gauge) Update

func (g *Gauge) Update(value float64)

Update updates the gauge value.

func (*Gauge) ValueOf

func (g *Gauge) ValueOf(aggType aggregation.Type) float64

ValueOf returns the value for the aggregation type.

type Options

type Options struct {
	// HasExpensiveAggregations means expensive (multiplication/division)
	// aggregation types are enabled.
	HasExpensiveAggregations bool
}

Options is the options for aggregations.

func NewOptions

func NewOptions() Options

NewOptions creates a new aggregation options.

func (*Options) ResetSetData

func (o *Options) ResetSetData(aggTypes aggregation.Types)

ResetSetData resets the aggregation options.

type Timer

type Timer struct {
	Options
	// contains filtered or unexported fields
}

Timer aggregates timer values. Timer APIs are not thread-safe.

func NewTimer

func NewTimer(quantiles []float64, streamOpts cm.Options, opts Options) Timer

NewTimer creates a new timer

func (*Timer) Add

func (t *Timer) Add(value float64)

Add adds a timer value.

func (*Timer) AddBatch

func (t *Timer) AddBatch(values []float64)

AddBatch adds a batch of timer values.

func (*Timer) Close

func (t *Timer) Close()

Close closes the timer.

func (*Timer) Count

func (t *Timer) Count() int64

Count returns the number of values received.

func (*Timer) Max

func (t *Timer) Max() float64

Max returns the maximum timer value.

func (*Timer) Mean

func (t *Timer) Mean() float64

Mean returns the mean timer value.

func (*Timer) Min

func (t *Timer) Min() float64

Min returns the minimum timer value.

func (*Timer) Quantile

func (t *Timer) Quantile(q float64) float64

Quantile returns the value at a given quantile.

func (*Timer) Stdev

func (t *Timer) Stdev() float64

Stdev returns the standard deviation timer value.

func (*Timer) Sum

func (t *Timer) Sum() float64

Sum returns the sum of timer values.

func (*Timer) SumSq

func (t *Timer) SumSq() float64

SumSq returns the squared sum of timer values.

func (*Timer) ValueOf

func (t *Timer) ValueOf(aggType aggregation.Type) float64

ValueOf returns the value for the aggregation type.

Directories

Path Synopsis
quantile
cm
Package cm implements the Cormode-Muthukrishnan algorithm for computing biased quantiles over data streams from "Effective Computation of Biased Quantiles over Data Streams" and is largely based on statsite's implementation in C: https://github.com/statsite/statsite/blob/master/src/cm_quantile.c
Package cm implements the Cormode-Muthukrishnan algorithm for computing biased quantiles over data streams from "Effective Computation of Biased Quantiles over Data Streams" and is largely based on statsite's implementation in C: https://github.com/statsite/statsite/blob/master/src/cm_quantile.c
tdigest
Package tdigest implements the t-digest algorithm for accurate on-line accumulation of rank-based statistics such as quantiles from "Computing Extremely Accurate Quantiles Using t-Digests" and is based on Ted Dunning's implementation in Java: https://github.com/tdunning/t-digest/blob/master/src/main/java/com/tdunning/math/stats/
Package tdigest implements the t-digest algorithm for accurate on-line accumulation of rank-based statistics such as quantiles from "Computing Extremely Accurate Quantiles Using t-Digests" and is based on Ted Dunning's implementation in Java: https://github.com/tdunning/t-digest/blob/master/src/main/java/com/tdunning/math/stats/

Jump to

Keyboard shortcuts

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