metricbatcher

package
v0.0.0-...-214ea07 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2015 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

package metricbatcher provides a mechanism to batch counter updates into a single event.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MetricBatcher

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

MetricBatcher batches counter increment/add calls into periodic, aggregate events.

func New

func New(metricSender metric_sender.MetricSender, batchDuration time.Duration) *MetricBatcher

New instantiates a running MetricBatcher. Eventswill be emitted once per batchDuration. All updates to a given counter name will be combined into a single event and sent to metricSender.

func (*MetricBatcher) BatchAddCounter

func (mb *MetricBatcher) BatchAddCounter(name string, delta uint64)

BatchAddCounter increments the named counter by the provided delta, but does not immediately send a CounterEvent.

func (*MetricBatcher) BatchIncrementCounter

func (mb *MetricBatcher) BatchIncrementCounter(name string)

BatchIncrementCounter increments the named counter by 1, but does not immediately send a CounterEvent.

func (*MetricBatcher) Close

func (mb *MetricBatcher) Close()

Closes the metrics batcher. Using the batcher after closing, will cause a panic.

func (*MetricBatcher) Reset

func (mb *MetricBatcher) Reset()

Reset clears the MetricBatcher's internal state, so that no counters are tracked.

Jump to

Keyboard shortcuts

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