stats

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Dec 28, 2015 License: Apache-2.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 DimensionKeeper

type DimensionKeeper interface {
	Stats(dimensions map[string]string) []*datapoint.Datapoint
}

A DimensionKeeper contains datapoints that describe its state and can be reported upstream

type Keeper

type Keeper interface {
	Stats() []*datapoint.Datapoint
}

A Keeper contains datapoints that describe its state and can be reported upstream

func Combine

func Combine(keepers ...Keeper) Keeper

Combine multiple keepers into a single keeper

func NewGolangKeeper

func NewGolangKeeper() Keeper

NewGolangKeeper returns a new stats keeper that can return internal golang stats

func ToKeeper

func ToKeeper(k DimensionKeeper, dims map[string]string) Keeper

ToKeeper creates a keeper that pulls stats from k with dims

func ToKeeperMany

func ToKeeperMany(dims map[string]string, keeps ...DimensionKeeper) Keeper

ToKeeperMany creates a single keeper that pulls stats from each of keeps with dims

type StatDrainingThread

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

StatDrainingThread will sleep delay between draining stats from each keeper and sending the full stats to each sendTo sink

func NewDrainingThread

func NewDrainingThread(delay time.Duration, sendTo []dpsink.Sink, listenFrom []Keeper, ctx context.Context, logger log.Logger) *StatDrainingThread

NewDrainingThread returns a new DrainingThread to collect stats and send them to sinks

func (*StatDrainingThread) Stats

func (thread *StatDrainingThread) Stats() []*datapoint.Datapoint

Stats returns all the stast this draining thread will report

Jump to

Keyboard shortcuts

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