metchan

package module
v0.0.0-...-c87547a Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2014 License: MIT Imports: 11 Imported by: 0

README

METCHAN

Count, Measure, and Time your Go system. Send the results to Librato.

http://godoc.org/github.com/ryandotsmith/metchan

FAQ

> Is this different than go-metrics?
< Probably not. I wrote this pkg a couple years ago and I recently extracted it into a public pkg. I wanted to use metchan out of comfort.

> What makes metchan so comfortable?
<
    func ƒ() {
        defer metchan.Time("ƒ", time.Now())
    }

Documentation

Overview

An internal metrics channel. Go systems 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
	// This will enable writting all metrics to a logger.
	Verbose bool
	// Short short circiut all calls to metchan. Useful for development.
	Enabled bool
	// The URL for librato. Must include username and password.
	Url *url.URL
	// The default source value for metrics submitted to Librato.
	Source string
	// All Librato metrics will be prefixed with this value.
	MetricPrefix string
	// Number of goroutines to use for sending HTTP requests to Librato.
	Concurrency int
	// Number of HTTP requests to buffer before sending to Librato API.
	BufferSize int

	sync.Mutex
	// contains filtered or unexported fields
}

func (*Channel) Count

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

func (*Channel) Measure

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

func (*Channel) Start

func (c *Channel) Start()

This function must be called in order for this package to do anything.

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.

Directories

Path Synopsis
A collection of measurements.
A collection of measurements.

Jump to

Keyboard shortcuts

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