metrics

package
v0.0.0-...-68efac8 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2014 License: Apache-2.0, Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package metrics provides a simple API for sending value and counter metrics through the dropsonde system.

Use

See the documentation for package autowire for details on configuring through environment variables.

Import the package (note that you do not need to additionally import autowire). The package self-initializes; to send metrics use

metrics.SendValue(name, value, unit)

for sending known quantities, and

metrics.IncrementCounter(name)

to increment a counter. (Note that the value of the counter is maintained by the receiver of the counter events, not the application that includes this package.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddToCounter

func AddToCounter(name string, delta uint64) error

AddToCounter sends an event to increment the named counter by the specified (positive) delta. Maintaining the value of the counter is the responsibility of the receiver, as with IncrementCounter.

func IncrementCounter

func IncrementCounter(name string) error

IncrementCounter sends an event to increment the named counter by one. Maintaining the value of the counter is the responsibility of the receiver of the event, not the process that includes this package.

func Initialize

func Initialize(ms metric_sender.MetricSender)

Initialize prepares the metrics package for use with the automatic Emitter from dropsonde/autowire. This function is called by the package's init method, so should only be explicitly called to reset the default MetricSender, e.g. in tests.

func SendValue

func SendValue(name string, value float64, unit string) error

SendValue sends a value event for the named metric. See http://metrics20.org/spec/#units for the specifications on allowed units.

Types

This section is empty.

Jump to

Keyboard shortcuts

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