stats

package
v0.0.0-...-fd2130c Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2018 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultExecutor

func DefaultExecutor(handler func(ctx context.Context))

Types

type Collector

type Collector interface {
	Collect(point *Point)
}

type CounterMonoid

type CounterMonoid uint64

func (*CounterMonoid) Add

func (monoid *CounterMonoid) Add(that Monoid)

func (*CounterMonoid) Export

func (monoid *CounterMonoid) Export() float64

type EventAggregator

type EventAggregator struct {
	Executor  Executor
	Collector Collector
}

func NewEventAggregator

func NewEventAggregator(init func(aggregator *EventAggregator)) *EventAggregator

func (*EventAggregator) HandlerOf

func (aggregator *EventAggregator) HandlerOf(site *logger.LogSite) logger.EventHandler

type Executor

type Executor func(func(ctx context.Context))

type MapMonoid

type MapMonoid map[interface{}]Monoid

func (MapMonoid) Add

func (monoid MapMonoid) Add(that MapMonoid)

type Monoid

type Monoid interface {
	Add(that Monoid)
	Export() float64
}

func NewCounterMonoid

func NewCounterMonoid() Monoid

type Point

type Point struct {
	Event     string
	Timestamp time.Time
	Dimension []string
	Value     float64
}

type State

type State interface {
	logger.EventHandler
	GetWindow() *Window
}

type Window

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

func (*Window) Export

func (window *Window) Export(now time.Time)

func (*Window) Mutate

func (window *Window) Mutate() (*sync.Mutex, MapMonoid)

Jump to

Keyboard shortcuts

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