瀏覽代碼

Merge pull request #126 from rcrowley/decprecategraphite

deprecate the graphite client in favor of the new separate lib
Mikhail P 10 年之前
父節點
當前提交
2d501d2abf
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 6 2
      README.md
  2. 2 0
      graphite.go

+ 6 - 2
README.md

@@ -47,11 +47,14 @@ 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:
@@ -112,3 +115,4 @@ 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)

+ 2 - 0
graphite.go

@@ -38,6 +38,7 @@ func Graphite(r Registry, d time.Duration, prefix string, addr *net.TCPAddr) {
 // GraphiteWithConfig is a blocking exporter function just like Graphite,
 // but it takes a GraphiteConfig instead.
 func GraphiteWithConfig(c GraphiteConfig) {
+	log.Printf("WARNING: This go-metrics client has been DEPRECATED! It has been moved to https://github.com/cyberdelia/go-metrics-graphite and will be removed from rcrowley/go-metrics on August 12th 2015")
 	for _ = range time.Tick(c.FlushInterval) {
 		if err := graphite(&c); nil != err {
 			log.Println(err)
@@ -49,6 +50,7 @@ func GraphiteWithConfig(c GraphiteConfig) {
 // non-nil error on failed connections. This can be used in a loop
 // similar to GraphiteWithConfig for custom error handling.
 func GraphiteOnce(c GraphiteConfig) error {
+	log.Printf("WARNING: This go-metrics client has been DEPRECATED! It has been moved to https://github.com/cyberdelia/go-metrics-graphite and will be removed from rcrowley/go-metrics on August 12th 2015")
 	return graphite(&c)
 }