stats

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2019 License: BSD-3-Clause, BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

Package stats provides support for recording telemetry statistics. It acts as a coordination point between things that want to record stats, and things that want to aggregate and report stats.

Index

Constants

View Source
const (
	// UnitDimensionless indicates that a measure has no specified units.
	UnitDimensionless = Unit(iota)
	// UnitBytes indicates that that a measure is recording number of bytes.
	UnitBytes
	// UnitMilliseconds indicates that a measure is recording a duration in milliseconds.
	UnitMilliseconds
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Float64Measure

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

Int64Measure is used to record floating point values.

func Float64 added in v0.0.22

func Float64(name string, description string, unit Unit) *Float64Measure

Float64 creates a new Float64Measure and prepares it for use.

func (*Float64Measure) Description added in v0.0.22

func (m *Float64Measure) Description() string

Description returns the description this measure was given on construction.

func (*Float64Measure) Name added in v0.0.22

func (m *Float64Measure) Name() string

Name returns the name this measure was given on construction.

func (*Float64Measure) Record added in v0.0.22

func (m *Float64Measure) Record(ctx context.Context, value float64)

Record delivers a new value to the subscribers of this measure.

func (*Float64Measure) Subscribe added in v0.0.22

func (m *Float64Measure) Subscribe(s Float64Subscriber)

Subscribe adds a new subscriber to this measure.

func (*Float64Measure) Unit added in v0.0.22

func (m *Float64Measure) Unit() Unit

Unit returns the units this measure was given on construction.

type Float64Subscriber added in v0.0.22

type Float64Subscriber func(context.Context, *Float64Measure, float64)

Float64Subscriber is the type for functions that want to listen to floating point statistic events.

type Int64Measure

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

Int64Measure is used to record integer values.

func Int64 added in v0.0.22

func Int64(name string, description string, unit Unit) *Int64Measure

Int64 creates a new Int64Measure and prepares it for use.

func (*Int64Measure) Description added in v0.0.22

func (m *Int64Measure) Description() string

Description returns the description this measure was given on construction.

func (*Int64Measure) Name added in v0.0.22

func (m *Int64Measure) Name() string

Name returns the name this measure was given on construction.

func (*Int64Measure) Record added in v0.0.22

func (m *Int64Measure) Record(ctx context.Context, value int64)

Record delivers a new value to the subscribers of this measure.

func (*Int64Measure) Subscribe added in v0.0.22

func (m *Int64Measure) Subscribe(s Int64Subscriber)

Subscribe adds a new subscriber to this measure.

func (*Int64Measure) Unit added in v0.0.22

func (m *Int64Measure) Unit() Unit

Unit returns the units this measure was given on construction.

type Int64Subscriber added in v0.0.22

type Int64Subscriber func(context.Context, *Int64Measure, int64)

Int64Subscriber is the type for functions that want to listen to integer statistic events.

type Unit added in v0.0.22

type Unit int

Unit is used to specify the units for a given measure. This is can used for display purposes.

Jump to

Keyboard shortcuts

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