statsd

package module
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2014 License: MIT Imports: 7 Imported by: 4

README

statsd

Statsd client which adheres to statsd/client-interface. A fork of github.com/cyberdelia/statsd.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is statsd client representing a onnection to a statsd server.

func Dial

func Dial(addr string) (*Client, error)

Dial connects to the given address on the given network using net.Dial and then returns a new Client for the connection.

func DialSize

func DialSize(addr string, size int) (*Client, error)

DialSize acts like Dial but takes a packet size. By default, the packet size is 512, see https://github.com/etsy/statsd/blob/master/docs/metric_types.md#multi-metric-packets for guidelines.

func DialTimeout

func DialTimeout(addr string, timeout time.Duration) (*Client, error)

DialTimeout acts like Dial but takes a timeout. The timeout includes name resolution, if required.

func NewClient

func NewClient(w io.Writer) *Client

NewClient returns a new client with the given writer, useful for testing.

func (*Client) Annotate added in v0.1.0

func (c *Client) Annotate(name string, value string, args ...interface{}) error

Annotate sends an annotation.

func (*Client) Close

func (c *Client) Close() error

Close closes the connection.

func (*Client) Decr

func (c *Client) Decr(name string) error

Decr decrements the counter for the given bucket by 1 at a rate of 1.

func (*Client) DecrBy

func (c *Client) DecrBy(name string, value int) error

DecrBy decrements the counter for the given bucket by N at a rate of 1.

func (*Client) Decrement

func (c *Client) Decrement(name string, count int, rate float64) error

Decrement decrements the counter for the given bucket.

func (*Client) Duration

func (c *Client) Duration(name string, duration time.Duration) error

Duration records time spent for the given bucket with time.Duration.

func (*Client) Flush

func (c *Client) Flush() error

Flush flushes writes any buffered data to the network. Just a no-op for now.

func (*Client) Gauge

func (c *Client) Gauge(name string, value int) error

Gauge records arbitrary values for the given bucket.

func (*Client) Histogram

func (c *Client) Histogram(name string, value int) error

Histogram is an alias of .Duration() until the statsd protocol figures its shit out.

func (*Client) Incr

func (c *Client) Incr(name string) error

Incr increments the counter for the given bucket by 1 at a rate of 1.

func (*Client) IncrBy

func (c *Client) IncrBy(name string, n int) error

IncrBy increments the counter for the given bucket by N at a rate of 1.

func (*Client) Increment

func (c *Client) Increment(name string, count int, rate float64) error

Increment increments the counter for the given bucket.

func (*Client) Prefix

func (c *Client) Prefix(s string)

Prefix adds a prefix to every stat string. The prefix is literal, so if you want "foo.bar.baz" from "baz" you should set the prefix to "foo.bar." not "foo.bar" as no delimiter is added for you.

func (*Client) Unique

func (c *Client) Unique(name string, value int, rate float64) error

Unique records unique occurences of events.

Jump to

Keyboard shortcuts

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