Documentation
¶
Overview ¶
Package ganglia has convenience functions for using ganglia.
This package uses the vlog utility package for logging various messages if the vlog.Verbose boolean is set to true.
Index ¶
Constants ¶
const ( String = gmetric.VALUE_STRING Ushort = gmetric.VALUE_UNSIGNED_SHORT Short = gmetric.VALUE_SHORT Uint = gmetric.VALUE_UNSIGNED_INT Int = gmetric.VALUE_INT Float = gmetric.VALUE_FLOAT Double = gmetric.VALUE_DOUBLE )
Variables ¶
var ( GmondConfig string Interval time.Duration )
Functions ¶
func AddGmetrics ¶
func AddGmetrics(callback ReporterCallback)
Convenience wrapper for Gmetric().AddCallback():
AddGmetrics(func(gmetric MetricSender) { gmetric("profit", "1000000.00", GmetricFloat, "dollars", true) })
func CommonGmetrics ¶
func CommonGmetrics(gmetric MetricSender)
func NewGmetric ¶
Types ¶
type MetricSender ¶
MetricSender takes the following parameters:
name: an arbitrary metric name value: the metric's current value metricType: one of GmetricString, GmetricUshort, GmetricShort, GmetricUint, GmetricInt, GmetricFloat, or GmetricDouble units: a label to include on the metric's Y axis rate: if true, send the rate relative to the last sample instead of an absolute value
type Reporter ¶
type Reporter struct { *stopper.ChanStopper // contains filtered or unexported fields }
func Gmetric ¶
func Gmetric() *Reporter
Gmetric returns a global Reporter that clients may hook into by calling AddCallback.
func NewGangliaReporter ¶
NewGangliaReporter returns a Reporter object which calls callback every interval with the given group name. callback is passed a Gmetric whose servers are initialized from the hosts gmond.conf. Calling Stop on the Reporter will cease its operation.
func NewGangliaReporterWithOptions ¶
NewGangliaReporterWithOptions is NewGangliaReporter with the groupName.
func (*Reporter) AddCallback ¶
func (gr *Reporter) AddCallback(callback ReporterCallback)
func (*Reporter) Configure ¶
Configure sets group name and prefix of a reporter and returns the reporter.
type ReporterCallback ¶
type ReporterCallback func(MetricSender)