go-statsd-client

module
v3.0.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2016 License: MIT

README

go-statsd-client

Build Status GoDoc

About

A StatsD client for Go.

Docs

Viewable online at godoc.org.

Example

import (
    "log"

    "github.com/cactus/go-statsd-client/statsd"
)

func main() {
    // first create a client
    // The basic client sends one stat per packet (for compatibility).
    client, err := statsd.NewClient("127.0.0.1:8125", "test-client")

    // A buffered client, which sends multiple stats in one packet, is
    // recommended when your server supports it (better performance).
    // client, err := statsd.NewBufferedClient("127.0.0.1:8125", "test-client", 300*time.Millisecond, 0)

    // handle any errors
    if err != nil {
        log.Fatal(err)
    }
    // make sure to clean up
    defer client.Close()

    // Send a stat
    client.Inc("stat1", 42, 1.0)
}

See docs for more info.

Contributors

See here.

Alternative Implementations

See the statsd wiki for some additional client implementations (scroll down to the Go section).

License

Released under the MIT license. See LICENSE.md file for details.

Directories

Path Synopsis
Package statsd provides a StatsD client implementation that is safe for concurrent use by multiple goroutines and for efficiency can be created and reused.
Package statsd provides a StatsD client implementation that is safe for concurrent use by multiple goroutines and for efficiency can be created and reused.

Jump to

Keyboard shortcuts

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