From 23a148807389486f468a6efc15e626bcb88b91ea Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 27 Nov 2016 08:27:40 -0500 Subject: [PATCH] remove "github.com/raintank/met" from vendor folder --- vendor/github.com/raintank/met/README.md | 15 ------ .../raintank/met/dogstatsd/count.go | 18 ------- .../raintank/met/dogstatsd/gauge.go | 51 ------------------ .../github.com/raintank/met/dogstatsd/init.go | 27 ---------- .../raintank/met/dogstatsd/meter.go | 20 ------- .../raintank/met/dogstatsd/timer.go | 23 -------- .../github.com/raintank/met/helper/helper.go | 25 --------- vendor/github.com/raintank/met/interfaces.go | 35 ------------- .../github.com/raintank/met/statsd/count.go | 18 ------- .../github.com/raintank/met/statsd/gauge.go | 52 ------------------- vendor/github.com/raintank/met/statsd/init.go | 14 ----- .../github.com/raintank/met/statsd/meter.go | 20 ------- .../github.com/raintank/met/statsd/timer.go | 23 -------- vendor/vendor.json | 24 --------- 14 files changed, 365 deletions(-) delete mode 100644 vendor/github.com/raintank/met/README.md delete mode 100644 vendor/github.com/raintank/met/dogstatsd/count.go delete mode 100644 vendor/github.com/raintank/met/dogstatsd/gauge.go delete mode 100644 vendor/github.com/raintank/met/dogstatsd/init.go delete mode 100644 vendor/github.com/raintank/met/dogstatsd/meter.go delete mode 100644 vendor/github.com/raintank/met/dogstatsd/timer.go delete mode 100644 vendor/github.com/raintank/met/helper/helper.go delete mode 100644 vendor/github.com/raintank/met/interfaces.go delete mode 100644 vendor/github.com/raintank/met/statsd/count.go delete mode 100644 vendor/github.com/raintank/met/statsd/gauge.go delete mode 100644 vendor/github.com/raintank/met/statsd/init.go delete mode 100644 vendor/github.com/raintank/met/statsd/meter.go delete mode 100644 vendor/github.com/raintank/met/statsd/timer.go diff --git a/vendor/github.com/raintank/met/README.md b/vendor/github.com/raintank/met/README.md deleted file mode 100644 index 4719c27bce..0000000000 --- a/vendor/github.com/raintank/met/README.md +++ /dev/null @@ -1,15 +0,0 @@ -an opinionated wrapper around metric client libraries - -imported from Grafana ffcc807ed34f853a8bc9600bcf7801547a5feb4f - -supports: -* statsd (recommended!) -* dogstatsd - -and later maybe more, like go-metrics - - -Why? -* make it easy to switch between libraries. -* some libraries just take in string arguments for gauge names etc, but it's nicer to have variables per object for robustness, especially when used in multiple places, and gives a central overview. -* allows you to set deleteGauges and deleteStats in your statsd servers ( a good thing for stateless servers), cause we will automatically keep a gauge sending. diff --git a/vendor/github.com/raintank/met/dogstatsd/count.go b/vendor/github.com/raintank/met/dogstatsd/count.go deleted file mode 100644 index beb519e9c3..0000000000 --- a/vendor/github.com/raintank/met/dogstatsd/count.go +++ /dev/null @@ -1,18 +0,0 @@ -package dogstatsd - -import "github.com/raintank/met" - -type Count struct { - key string - backend Backend -} - -func (b Backend) NewCount(key string) met.Count { - c := Count{key, b} - c.Inc(0) - return c -} - -func (c Count) Inc(val int64) { - c.backend.client.Count(c.key, val, []string{}, 1) -} diff --git a/vendor/github.com/raintank/met/dogstatsd/gauge.go b/vendor/github.com/raintank/met/dogstatsd/gauge.go deleted file mode 100644 index e3836187a4..0000000000 --- a/vendor/github.com/raintank/met/dogstatsd/gauge.go +++ /dev/null @@ -1,51 +0,0 @@ -package dogstatsd - -import ( - "sync" - "time" -) -import "github.com/raintank/met" - -type Gauge struct { - key string - val int64 - sync.Mutex - backend Backend -} - -func (b Backend) NewGauge(key string, val int64) met.Gauge { - g := Gauge{ - key: key, - backend: b, - } - go func() { - for { - g.Lock() - g.backend.client.Gauge(g.key, float64(g.val), []string{}, 1) - g.Unlock() - time.Sleep(time.Duration(1) * time.Second) - } - }() - return &g -} - -func (g *Gauge) Value(val int64) { - g.Lock() - defer g.Unlock() - g.val = val - g.backend.client.Gauge(g.key, float64(g.val), []string{}, 1) -} - -func (g *Gauge) Inc(val int64) { - g.Lock() - defer g.Unlock() - g.val += val - g.backend.client.Gauge(g.key, float64(g.val), []string{}, 1) -} - -func (g *Gauge) Dec(val int64) { - g.Lock() - defer g.Unlock() - g.val -= val - g.backend.client.Gauge(g.key, float64(g.val), []string{}, 1) -} diff --git a/vendor/github.com/raintank/met/dogstatsd/init.go b/vendor/github.com/raintank/met/dogstatsd/init.go deleted file mode 100644 index ccb968719f..0000000000 --- a/vendor/github.com/raintank/met/dogstatsd/init.go +++ /dev/null @@ -1,27 +0,0 @@ -// a metrics class that uses dogstatsd on the backend - -// note that on creation, we automatically send a default value so that: -// * influxdb doesn't complain when queried for series that don't exist yet, which breaks graphs in grafana -// * the series show up in your monitoring tool of choice, so you can easily do alerting rules, build dashes etc -// without having to wait for data. some series would otherwise only be created when things go badly wrong etc. -// note that for gauges and timers this can create inaccuracies because the true values are hard to predict, -// but it's worth the trade-off. -// (for count 0 is harmless and accurate) - -package dogstatsd - -import "github.com/DataDog/datadog-go/statsd" - -type Backend struct { - client *statsd.Client -} - -// note: library does not auto-add ending dot to prefix, specify it if you want it -func New(addr, prefix string, tags []string) (Backend, error) { - client, err := statsd.New(addr) - if err == nil { - client.Namespace = prefix - client.Tags = tags - } - return Backend{client}, err -} diff --git a/vendor/github.com/raintank/met/dogstatsd/meter.go b/vendor/github.com/raintank/met/dogstatsd/meter.go deleted file mode 100644 index 0ed5437502..0000000000 --- a/vendor/github.com/raintank/met/dogstatsd/meter.go +++ /dev/null @@ -1,20 +0,0 @@ -// it's commonly used for non-timer cases where we want these summaries, that's -// what this is for. -package dogstatsd - -import "github.com/raintank/met" - -type Meter struct { - key string - backend Backend -} - -func (b Backend) NewMeter(key string, val int64) met.Meter { - m := Meter{key, b} - m.Value(val) - return m -} - -func (m Meter) Value(val int64) { - m.backend.client.Histogram(m.key, float64(val), []string{}, 1) -} diff --git a/vendor/github.com/raintank/met/dogstatsd/timer.go b/vendor/github.com/raintank/met/dogstatsd/timer.go deleted file mode 100644 index 711cf9ee49..0000000000 --- a/vendor/github.com/raintank/met/dogstatsd/timer.go +++ /dev/null @@ -1,23 +0,0 @@ -package dogstatsd - -import "time" -import "github.com/raintank/met" - -// note that due the preseeding in init, you shouldn't rely on the count and count_ps summaries -// rather, consider maintaining a separate counter -// see https://github.com/raintank/grafana/issues/133 - -type Timer struct { - key string - backend Backend -} - -func (b Backend) NewTimer(key string, val time.Duration) met.Timer { - t := Timer{key, b} - t.Value(val) - return t -} - -func (t Timer) Value(val time.Duration) { - t.backend.client.TimeInMilliseconds(t.key, val.Seconds()*1000, []string{}, 1) -} diff --git a/vendor/github.com/raintank/met/helper/helper.go b/vendor/github.com/raintank/met/helper/helper.go deleted file mode 100644 index aef46e8a42..0000000000 --- a/vendor/github.com/raintank/met/helper/helper.go +++ /dev/null @@ -1,25 +0,0 @@ -package helper - -import ( - "fmt" - - "github.com/raintank/met" - "github.com/raintank/met/dogstatsd" - "github.com/raintank/met/statsd" -) - -func New(enabled bool, addr, t, service, instance string) (met.Backend, error) { - if t != "standard" && t != "datadog" { - panic(fmt.Sprintf("unrecognized statsd type: '%s'", t)) - } - if !enabled { - // we could implement a true "null-backend" - // but since statsd supports disabled mode, this is easier - return statsd.New(enabled, addr, "") - } - if t == "standard" { - return statsd.New(enabled, addr, fmt.Sprintf("%s.%s.", service, instance)) - } else { - return dogstatsd.New(addr, service+".", []string{"instance:" + instance}) - } -} diff --git a/vendor/github.com/raintank/met/interfaces.go b/vendor/github.com/raintank/met/interfaces.go deleted file mode 100644 index cd8d14d2e8..0000000000 --- a/vendor/github.com/raintank/met/interfaces.go +++ /dev/null @@ -1,35 +0,0 @@ -package met - -import "time" - -type Backend interface { - NewCount(key string) Count - NewGauge(key string, val int64) Gauge - NewMeter(key string, val int64) Meter - NewTimer(key string, val time.Duration) Timer -} - -// Count is a type that counts how many hits it's seen in each given interval -// and computes the rate per second -// it's not a long-running counter. -// values are explicit -type Count interface { - Inc(val int64) -} - -// gauge makes sure its value is explicit (i.e. for statsd, keep sending) -type Gauge interface { - Dec(val int64) - Inc(val int64) - Value(val int64) -} - -// like a timer, but not just for timings -type Meter interface { - Value(val int64) -} - -// computes stasticical summaries -type Timer interface { - Value(val time.Duration) -} diff --git a/vendor/github.com/raintank/met/statsd/count.go b/vendor/github.com/raintank/met/statsd/count.go deleted file mode 100644 index f04a9dabc9..0000000000 --- a/vendor/github.com/raintank/met/statsd/count.go +++ /dev/null @@ -1,18 +0,0 @@ -package statsd - -import "github.com/raintank/met" - -type Count struct { - key string - backend Backend -} - -func (b Backend) NewCount(key string) met.Count { - c := Count{key, b} - c.Inc(0) - return c -} - -func (c Count) Inc(val int64) { - c.backend.client.Count(c.key, int(val), 1) -} diff --git a/vendor/github.com/raintank/met/statsd/gauge.go b/vendor/github.com/raintank/met/statsd/gauge.go deleted file mode 100644 index 34ae8e9e33..0000000000 --- a/vendor/github.com/raintank/met/statsd/gauge.go +++ /dev/null @@ -1,52 +0,0 @@ -package statsd - -import ( - "sync" - "time" - - "github.com/raintank/met" -) - -type Gauge struct { - key string - val int64 - sync.Mutex - backend Backend -} - -func (b Backend) NewGauge(key string, val int64) met.Gauge { - g := Gauge{ - key: key, - backend: b, - } - go func() { - for { - g.Lock() - g.backend.client.Gauge(g.key, int(g.val)) - g.Unlock() - time.Sleep(time.Duration(1) * time.Second) - } - }() - return &g -} - -func (g *Gauge) Value(val int64) { - g.Lock() - g.val = val - g.Unlock() - g.backend.client.Gauge(g.key, int(val)) -} - -func (g *Gauge) Inc(val int64) { - g.Lock() - defer g.Unlock() - g.val += val - g.backend.client.Gauge(g.key, int(g.val)) -} - -func (g *Gauge) Dec(val int64) { - g.Lock() - defer g.Unlock() - g.val -= val - g.backend.client.Gauge(g.key, int(g.val)) -} diff --git a/vendor/github.com/raintank/met/statsd/init.go b/vendor/github.com/raintank/met/statsd/init.go deleted file mode 100644 index 4bf7ecc12a..0000000000 --- a/vendor/github.com/raintank/met/statsd/init.go +++ /dev/null @@ -1,14 +0,0 @@ -package statsd - -import "github.com/alexcesaro/statsd" - -type Backend struct { - client *statsd.Client -} - -// note: library does not auto add ending dot to prefix. -func New(enabled bool, addr, prefix string) (Backend, error) { - client, err := statsd.New(addr, statsd.WithPrefix(prefix), statsd.Mute(!enabled)) - b := Backend{client} - return b, err -} diff --git a/vendor/github.com/raintank/met/statsd/meter.go b/vendor/github.com/raintank/met/statsd/meter.go deleted file mode 100644 index 34a01460d6..0000000000 --- a/vendor/github.com/raintank/met/statsd/meter.go +++ /dev/null @@ -1,20 +0,0 @@ -// it's commonly used for non-timer cases where we want these summaries, that's -// what this is for. -package statsd - -import "github.com/raintank/met" - -type Meter struct { - key string - backend Backend -} - -func (b Backend) NewMeter(key string, val int64) met.Meter { - m := Meter{key, b} - m.Value(val) - return m -} - -func (m Meter) Value(val int64) { - m.backend.client.Timing(m.key, int(val), 1) -} diff --git a/vendor/github.com/raintank/met/statsd/timer.go b/vendor/github.com/raintank/met/statsd/timer.go deleted file mode 100644 index f4a72fb437..0000000000 --- a/vendor/github.com/raintank/met/statsd/timer.go +++ /dev/null @@ -1,23 +0,0 @@ -package statsd - -import "time" -import "github.com/raintank/met" - -// note that due the preseeding in init, you shouldn't rely on the count and count_ps summaries -// rather, consider maintaining a separate counter -// see https://github.com/raintank/grafana/issues/133 - -type Timer struct { - key string - backend Backend -} - -func (b Backend) NewTimer(key string, val time.Duration) met.Timer { - t := Timer{key, b} - t.Value(val) - return t -} - -func (t Timer) Value(val time.Duration) { - t.backend.client.Timing(t.key, int(val/time.Millisecond), 1) -} diff --git a/vendor/vendor.json b/vendor/vendor.json index efc0e6241b..ca966a6ac2 100644 --- a/vendor/vendor.json +++ b/vendor/vendor.json @@ -260,30 +260,6 @@ "revision": "7b06fb4cf9324a785c2dedea9aa4e47769d54b92", "revisionTime": "2016-07-13T16:23:06Z" }, - { - "checksumSHA1": "bgKeW8sz3mMg/3QlazFovSIsjLc=", - "path": "github.com/raintank/met", - "revision": "daf6d57fc20532f01eb2320040a8054b5618cbf1", - "revisionTime": "2016-01-13T08:38:23Z" - }, - { - "checksumSHA1": "strvyPp3CIOymoYh9/PrKXs37C0=", - "path": "github.com/raintank/met/dogstatsd", - "revision": "daf6d57fc20532f01eb2320040a8054b5618cbf1", - "revisionTime": "2016-01-13T08:38:23Z" - }, - { - "checksumSHA1": "6PsyVJUl7ZJkemp8MEOhDU/iag4=", - "path": "github.com/raintank/met/helper", - "revision": "daf6d57fc20532f01eb2320040a8054b5618cbf1", - "revisionTime": "2016-01-13T08:38:23Z" - }, - { - "checksumSHA1": "hCKwS6ZHAUomcH/ukmDo366wSE8=", - "path": "github.com/raintank/met/statsd", - "revision": "daf6d57fc20532f01eb2320040a8054b5618cbf1", - "revisionTime": "2016-01-13T08:38:23Z" - }, { "checksumSHA1": "G5q2mryb77aa5RqtRSIiIXZpTcA=", "path": "github.com/raintank/misc/app",