aggregate

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2016 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Accumulator

type Accumulator interface {
	Accumulate(context.Context, interface{})
	Combine(interface{})
}

Accumulator is an object that can accumulate statistics based on individual objects within a context.

func Pipeline

func Pipeline(
	ctx context.Context,
	in chan interface{},

	newAccumulator func() Accumulator,
) Accumulator

Pipeline runs a concurrent processing pipeline that executes a given function for every value read off of an input channel. The KeyValue object provided to the processor function is only accessable to one of the go routines within the pipeline.

type Float64

type Float64 map[string]float64

func NewFloat64

func NewFloat64() Float64

func (Float64) Add

func (a Float64) Add(key string, delta float64)

func (Float64) Combine

func (a Float64) Combine(b Float64)

func (Float64) Keys

func (a Float64) Keys() []string

func (Float64) Ratio

func (a Float64) Ratio(numerator, denominator string) float64

func (Float64) Total

func (a Float64) Total(key string) float64

type Int

type Int map[string]int

func NewInt

func NewInt() Int

func (Int) Add

func (a Int) Add(key string, delta int)

func (Int) Combine

func (a Int) Combine(b Int)

func (Int) Keys

func (a Int) Keys() []string

func (Int) Ratio

func (a Int) Ratio(numerator, denominator string) float64

func (Int) Total

func (a Int) Total(key string) int

type Newest added in v0.3.4

type Newest struct {
	Time  time.Time
	Valid bool
}

func NewNewest added in v0.3.4

func NewNewest() *Newest

func (*Newest) Check added in v0.3.4

func (a *Newest) Check(t time.Time)

func (*Newest) Combine added in v0.3.4

func (a *Newest) Combine(t *Newest)

type Oldest added in v0.3.4

type Oldest struct {
	Time  time.Time
	Valid bool
}

func NewOldest added in v0.3.4

func NewOldest() *Oldest

func (*Oldest) Check added in v0.3.4

func (a *Oldest) Check(t time.Time)

func (*Oldest) Combine added in v0.3.4

func (a *Oldest) Combine(t *Oldest)

Jump to

Keyboard shortcuts

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