memcache2graphite 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/bin/memcache2graphite +5 -4
  2. data/conf.yml +1 -1
  3. metadata +1 -1
@@ -16,10 +16,10 @@ graphite = Graphite.new({
16
16
  memcache_conf = conf["memcache"]
17
17
  options = {}
18
18
  if memcache_conf["username"]
19
- options[:username] = bucket["username"]
19
+ options[:username] = memcache_conf["username"]
20
20
  end
21
21
  if memcache_conf["password"]
22
- options[:password] = bucket["password"]
22
+ options[:password] = memcache_conf["password"]
23
23
  end
24
24
  memcache = Dalli::Client.new("#{memcache_conf.fetch("host","localhost")}:#{memcache_conf.fetch("port",11211)}", options)
25
25
 
@@ -40,9 +40,10 @@ def collect(conf, memcache, graphite, state)
40
40
  message = {}
41
41
  memcache.stats.each do |node, metrics|
42
42
  metrics.select{|metric, value| metrics_filter.has_key?(metric)}.each do |metric, value|
43
- to_send = aggregate(metric, value, metrics_filter[metric], state)
43
+ type = metrics_filter[metric]
44
+ to_send = aggregate(metric, value, type, state)
44
45
  if to_send
45
- message["#{conf["graphite"]["root-path"]}.#{metrics_filter[metric]}.#{metric}"] = value
46
+ message["#{conf["graphite"]["root-path"].gsub(/<type>/,type)}.#{metrics_filter[metric]}.#{metric}"] = value
46
47
  end
47
48
  end
48
49
  end
data/conf.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  freq : 1
2
2
  graphite :
3
- root-path : toto.memcache.my_bucket.debian-sf
3
+ root-path : toto.memcache.my_bucket.<type>.debian-sf
4
4
  host : localhost
5
5
  port : 3333
6
6
  type : udp
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcache2graphite
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: