aboutsummaryrefslogtreecommitdiffstats
path: root/Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go
diff options
context:
space:
mode:
authorJeffrey Wilcke <jeffrey@ethereum.org>2016-02-17 20:46:30 +0800
committerJeffrey Wilcke <jeffrey@ethereum.org>2016-02-17 20:46:30 +0800
commitaa36a6ae4f24f07e2c470a21c93ff37ad5861982 (patch)
treedba654e20554d28383c1f3bb8164fa9f5849d1bd /Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go
parent4f28c5b69d652e12adf8a88f526f459a492e159e (diff)
parent6ba7bbbe29029c8bf2bf75f8ebcbd3847eafa401 (diff)
downloadgo-tangerine-aa36a6ae4f24f07e2c470a21c93ff37ad5861982.tar
go-tangerine-aa36a6ae4f24f07e2c470a21c93ff37ad5861982.tar.gz
go-tangerine-aa36a6ae4f24f07e2c470a21c93ff37ad5861982.tar.bz2
go-tangerine-aa36a6ae4f24f07e2c470a21c93ff37ad5861982.tar.lz
go-tangerine-aa36a6ae4f24f07e2c470a21c93ff37ad5861982.tar.xz
go-tangerine-aa36a6ae4f24f07e2c470a21c93ff37ad5861982.tar.zst
go-tangerine-aa36a6ae4f24f07e2c470a21c93ff37ad5861982.zip
Merge pull request #2206 from fjl/update-deps
Godeps: update all dependencies
Diffstat (limited to 'Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go')
-rw-r--r--Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go b/Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go
index dfaae2f28..d7c057468 100644
--- a/Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go
+++ b/Godeps/_workspace/src/github.com/rcrowley/go-metrics/librato/librato.go
@@ -23,6 +23,7 @@ func translateTimerAttributes(d time.Duration) (attrs map[string]interface{}) {
type Reporter struct {
Email, Token string
+ Namespace string
Source string
Interval time.Duration
Registry metrics.Registry
@@ -32,7 +33,7 @@ type Reporter struct {
}
func NewReporter(r metrics.Registry, d time.Duration, e string, t string, s string, p []float64, u time.Duration) *Reporter {
- return &Reporter{e, t, s, d, r, p, translateTimerAttributes(u), int64(d / time.Second)}
+ return &Reporter{e, t, "", s, d, r, p, translateTimerAttributes(u), int64(d / time.Second)}
}
func Librato(r metrics.Registry, d time.Duration, e string, t string, s string, p []float64, u time.Duration) {
@@ -40,6 +41,7 @@ func Librato(r metrics.Registry, d time.Duration, e string, t string, s string,
}
func (self *Reporter) Run() {
+ log.Printf("WARNING: This client has been DEPRECATED! It has been moved to https://github.com/mihasya/go-metrics-librato and will be removed from rcrowley/go-metrics on August 5th 2015")
ticker := time.Tick(self.Interval)
metricsApi := &LibratoClient{self.Email, self.Token}
for now := range ticker {
@@ -87,6 +89,9 @@ func (self *Reporter) BuildRequest(now time.Time, r metrics.Registry) (snapshot
snapshot.Counters = make([]Measurement, 0)
histogramGaugeCount := 1 + len(self.Percentiles)
r.Each(func(name string, metric interface{}) {
+ if self.Namespace != "" {
+ name = fmt.Sprintf("%s.%s", self.Namespace, name)
+ }
measurement := Measurement{}
measurement[Period] = self.Interval.Seconds()
switch m := metric.(type) {