tools: golang.org/x/tools/internal/telemetry/stats Index | Files

package stats

import "golang.org/x/tools/internal/telemetry/stats"

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

Package Files

stats.go worker.go

type Float64Measure Uses

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

Int64Measure is used to record floating point values.

func Float64 Uses

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

Float64 creates a new Float64Measure and prepares it for use.

func (*Float64Measure) Description Uses

func (m *Float64Measure) Description() string

Description returns the description this measure was given on construction.

func (*Float64Measure) Name Uses

func (m *Float64Measure) Name() string

Name returns the name this measure was given on construction.

func (*Float64Measure) Record Uses

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

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

func (*Float64Measure) Subscribe Uses

func (m *Float64Measure) Subscribe(s Float64Subscriber)

Subscribe adds a new subscriber to this measure.

func (*Float64Measure) Unit Uses

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

Unit returns the units this measure was given on construction.

type Float64Subscriber Uses

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 Uses

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

Int64Measure is used to record integer values.

func Int64 Uses

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

Int64 creates a new Int64Measure and prepares it for use.

func (*Int64Measure) Description Uses

func (m *Int64Measure) Description() string

Description returns the description this measure was given on construction.

func (*Int64Measure) Name Uses

func (m *Int64Measure) Name() string

Name returns the name this measure was given on construction.

func (*Int64Measure) Record Uses

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

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

func (*Int64Measure) Subscribe Uses

func (m *Int64Measure) Subscribe(s Int64Subscriber)

Subscribe adds a new subscriber to this measure.

func (*Int64Measure) Unit Uses

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

Unit returns the units this measure was given on construction.

type Int64Subscriber Uses

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.

Package stats imports 5 packages (graph) and is imported by 6 packages. Updated 2019-11-15. Refresh now. Tools for package owners.