metrics

package
v1.0.0-beta2 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2017 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestStatsReporter

type TestStatsReporter struct {
	CountersWG sync.WaitGroup
	GaugesWG   sync.WaitGroup
	TimersWG   sync.WaitGroup

	Counters           map[string]int64
	Gauges             map[string]float64
	Timers             map[string]time.Duration
	HistogramSamples   map[string]tally.Buckets
	HistogramDurations map[string]tally.Buckets
	// contains filtered or unexported fields
}

TestStatsReporter allows for easy testing of any metrics related functionality

func NewTestScope

func NewTestScope() (tally.Scope, *TestStatsReporter)

NewTestScope returns a pair of scope and reporter that can be used for testing

func NewTestStatsReporter

func NewTestStatsReporter() *TestStatsReporter

NewTestStatsReporter returns new instance of test stats reporter

func (*TestStatsReporter) Capabilities

func (r *TestStatsReporter) Capabilities() tally.Capabilities

Capabilities is a nop in this case

func (*TestStatsReporter) Flush

func (r *TestStatsReporter) Flush()

Flush is a nop

func (*TestStatsReporter) ReportCounter

func (r *TestStatsReporter) ReportCounter(name string, tags map[string]string, value int64)

ReportCounter collects all the counters into a map

func (*TestStatsReporter) ReportGauge

func (r *TestStatsReporter) ReportGauge(name string, tags map[string]string, value float64)

ReportGauge collects all the gauges into a map

func (*TestStatsReporter) ReportHistogramDurationSamples

func (r *TestStatsReporter) ReportHistogramDurationSamples(
	name string,
	tags map[string]string,
	buckets tally.Buckets,
	bucketLowerBound,
	bucketUpperBound time.Duration,
	samples int64,
)

ReportHistogramDurationSamples reports histogram samples for a bucket

func (*TestStatsReporter) ReportHistogramValueSamples

func (r *TestStatsReporter) ReportHistogramValueSamples(
	name string,
	tags map[string]string,
	buckets tally.Buckets,
	bucketLowerBound,
	bucketUpperBound float64,
	samples int64,
)

ReportHistogramValueSamples reports histogram samples for a bucket

func (*TestStatsReporter) ReportTimer

func (r *TestStatsReporter) ReportTimer(name string, tags map[string]string, interval time.Duration)

ReportTimer collects all the timers into a map

Jump to

Keyboard shortcuts

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