stats

package
Version: v0.456.0 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2021 License: Apache-2.0 Imports: 4 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

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Float64Measure

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

Float64Measure is used to record floating point values.

func Float64

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

Float64 creates a new Float64Measure and prepares it for use.

func (*Float64Measure) Description

func (m *Float64Measure) Description() string

Description returns the description this measure was given on construction.

func (*Float64Measure) Name

func (m *Float64Measure) Name() string

Name returns the name this measure was given on construction.

func (*Float64Measure) Record

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

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

func (*Float64Measure) Subscribe

func (m *Float64Measure) Subscribe(s Float64Subscriber)

Subscribe adds a new subscriber to this measure.

func (*Float64Measure) Unit

func (m *Float64Measure) Unit() unit.Unit

Unit returns the units this measure was given on construction.

type Float64Subscriber

type Float64Subscriber func(ctx context.Context, fm *Float64Measure, value float64, at time.Time)

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

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

Int64 creates a new Int64Measure and prepares it for use.

func (*Int64Measure) Description

func (m *Int64Measure) Description() string

Description returns the description this measure was given on construction.

func (*Int64Measure) Name

func (m *Int64Measure) Name() string

Name returns the name this measure was given on construction.

func (*Int64Measure) Record

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

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

func (*Int64Measure) Subscribe

func (m *Int64Measure) Subscribe(s Int64Subscriber)

Subscribe adds a new subscriber to this measure.

func (*Int64Measure) Unit

func (m *Int64Measure) Unit() unit.Unit

Unit returns the units this measure was given on construction.

type Int64Subscriber

type Int64Subscriber func(ctx context.Context, im *Int64Measure, value int64, at time.Time)

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

Source Files

Jump to

Keyboard shortcuts

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