diff options
Diffstat (limited to 'Godeps/_workspace/src/github.com/rcrowley/go-metrics/README.md')
-rw-r--r-- | Godeps/_workspace/src/github.com/rcrowley/go-metrics/README.md | 49 |
1 files changed, 42 insertions, 7 deletions
diff --git a/Godeps/_workspace/src/github.com/rcrowley/go-metrics/README.md b/Godeps/_workspace/src/github.com/rcrowley/go-metrics/README.md index e0091a4bd..66ba9cab5 100644 --- a/Godeps/_workspace/src/github.com/rcrowley/go-metrics/README.md +++ b/Godeps/_workspace/src/github.com/rcrowley/go-metrics/README.md @@ -1,7 +1,9 @@ go-metrics ========== -Go port of Coda Hale's Metrics library: <https://github.com/codahale/metrics>. +![travis build status](https://travis-ci.org/rcrowley/go-metrics.svg?branch=master) + +Go port of Coda Hale's Metrics library: <https://github.com/dropwizard/metrics>. Documentation: <http://godoc.org/github.com/rcrowley/go-metrics>. @@ -37,7 +39,7 @@ t.Update(47) Periodically log every metric in human-readable form to standard error: ```go -go metrics.Log(metrics.DefaultRegistry, 60e9, log.New(os.Stderr, "metrics: ", log.Lmicroseconds)) +go metrics.Log(metrics.DefaultRegistry, 5 * time.Second, log.New(os.Stderr, "metrics: ", log.Lmicroseconds)) ``` Periodically log every metric in slightly-more-parseable form to syslog: @@ -47,15 +49,23 @@ w, _ := syslog.Dial("unixgram", "/dev/log", syslog.LOG_INFO, "metrics") go metrics.Syslog(metrics.DefaultRegistry, 60e9, w) ``` -Periodically emit every metric to Graphite: +Periodically emit every metric to Graphite using the [Graphite client](https://github.com/cyberdelia/go-metrics-graphite): ```go + +import "github.com/cyberdelia/go-metrics-graphite" + addr, _ := net.ResolveTCPAddr("tcp", "127.0.0.1:2003") -go metrics.Graphite(metrics.DefaultRegistry, 10e9, "metrics", addr) +go graphite.Graphite(metrics.DefaultRegistry, 10e9, "metrics", addr) ``` Periodically emit every metric into InfluxDB: +**NOTE:** this has been pulled out of the library due to constant fluctuations +in the InfluxDB API. In fact, all client libraries are on their way out. see +issues [#121](https://github.com/rcrowley/go-metrics/issues/121) and +[#124](https://github.com/rcrowley/go-metrics/issues/124) for progress and details. + ```go import "github.com/rcrowley/go-metrics/influxdb" @@ -67,17 +77,20 @@ go influxdb.Influxdb(metrics.DefaultRegistry, 10e9, &influxdb.Config{ }) ``` -Periodically upload every metric to Librato: +Periodically upload every metric to Librato using the [Librato client](https://github.com/mihasya/go-metrics-librato): + +**Note**: the client included with this repository under the `librato` package +has been deprecated and moved to the repository linked above. ```go -import "github.com/rcrowley/go-metrics/librato" +import "github.com/mihasya/go-metrics-librato" go librato.Librato(metrics.DefaultRegistry, 10e9, // interval "example@example.com", // account owner email address "token", // Librato API token "hostname", // source - []float64{0.95}, // precentiles to send + []float64{0.95}, // percentiles to send time.Millisecond, // time unit ) ``` @@ -90,6 +103,19 @@ import "github.com/rcrowley/go-metrics/stathat" go stathat.Stathat(metrics.DefaultRegistry, 10e9, "example@example.com") ``` +Maintain all metrics along with expvars at `/debug/metrics`: + +This uses the same mechanism as [the official expvar](http://golang.org/pkg/expvar/) +but exposed under `/debug/metrics`, which shows a json representation of all your usual expvars +as well as all your go-metrics. + + +```go +import "github.com/rcrowley/go-metrics/exp" + +exp.Exp(metrics.DefaultRegistry) +``` + Installation ------------ @@ -102,3 +128,12 @@ StatHat support additionally requires their Go client: ```sh go get github.com/stathat/go ``` + +Publishing Metrics +------------------ + +Clients are available for the following destinations: + +* Librato - [https://github.com/mihasya/go-metrics-librato](https://github.com/mihasya/go-metrics-librato) +* Graphite - [https://github.com/cyberdelia/go-metrics-graphite](https://github.com/cyberdelia/go-metrics-graphite) +* InfluxDB - [https://github.com/vrischmann/go-metrics-influxdb](https://github.com/vrischmann/go-metrics-influxdb) |