collect

package
v0.0.0-...-7afe134 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2014 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package collect provides functions for sending data to OpenTSDB.

The "collect" namespace is used (i.e., <metric_root>.collect) to collect program and queue metrics.

Index

Constants

This section is empty.

Variables

View Source
var (
	// Freq is how often metrics are sent to OpenTSDB.
	Freq = time.Second * 15

	// MaxQueueLen is the maximum size of the queue, above which incoming data will
	// be discarded. Defaults to about 150MB.
	MaxQueueLen = 200000

	// BatchSize is the maximum length of data points sent at once to OpenTSDB.
	BatchSize = 250

	// Debug enables debug logging.
	Debug = false

	// Print prints all datapoints to stdout instead of sending them.
	Print = false

	// DisableDefaultCollectors prevents the scollector self metrics from being
	// generated.
	DisableDefaultCollectors = false
)

Functions

func Add

func Add(metric string, ts opentsdb.TagSet, inc int64) error

Add takes a metric and increments a counter for that metric. The metric name is appended to the basename specified in the Init function.

func Init

func Init(tsdbhost *url.URL, metric_root string) error

Init sets up the channels and the queue for sending data to OpenTSDB. It also sets up the basename for all metrics.

func InitChan

func InitChan(tsdbhost *url.URL, metric_root string, ch chan *opentsdb.DataPoint) error

InitChan is similar to Init, but uses the given channel instead of creating a new one.

func Put

func Put(metric string, ts opentsdb.TagSet, v interface{}) error

Put is useful for capturing "events" that have a gauge value. Subsequent calls between the sending interval will overwrite previous calls.

func Set

func Set(metric string, ts opentsdb.TagSet, f func() interface{}) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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