metchan

package
v0.0.0-...-de99981 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2014 License: GPL-3.0 Imports: 13 Imported by: 21

Documentation

Overview

An internal metrics channel. l2met internal components can publish their metrics here and they will be outletted to Librato.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Channel

type Channel struct {
	// The time by which metchan will aggregate internal metrics.
	FlushInterval time.Duration
	// The Channel is thread-safe.
	sync.Mutex

	Enabled bool
	Buffer  map[string]*bucket.Bucket
	// contains filtered or unexported fields
}

func New

func New(cfg *conf.D) *Channel

Returns an initialized Metchan Channel. Creates a new HTTP client for direct access to Librato. This channel is orthogonal with other librato http clients in l2met. If a blank URL is given, no metric posting attempt will be made. If verbose is set to true, the metric will be printed to STDOUT regardless of whether the metric is sent to Librato.

func (*Channel) CountReq

func (c *Channel) CountReq(user string)

func (*Channel) Measure

func (c *Channel) Measure(name string, v float64)

func (*Channel) Start

func (c *Channel) Start()

func (*Channel) Time

func (c *Channel) Time(name string, t time.Time)

Provide the time at which you started your measurement. Places the measurement in a buffer to be aggregated and eventually flushed to Librato.

Jump to

Keyboard shortcuts

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