beanstalkd-stats 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/bin/beanstalkd-stats +5 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2043c953e3d5c911906af03e946c8c67c606436
4
- data.tar.gz: f5b0fcb730ab6cde4d2c7428f4b93119fd1aa7e1
3
+ metadata.gz: 869e35bd4cf7db5c57c65789f0b765a7673b8bda
4
+ data.tar.gz: e3bc15a542ee5cdbe56bfc6fb998eb7bf00e06e7
5
5
  SHA512:
6
- metadata.gz: 2bfd67da642dc5192493247a941b0ec5adc3c85618c25366bcdcd1f377754149cfd8750d0972ff0d3d6d514e93b88c79350e28f38c2a65354bb8b022540110a2
7
- data.tar.gz: 07e60b45d20118183d0415f2b2d4f24404f5b121701e3e2a3339c650ff54480eeb8a7be4b980c0abf439d29e73edd9e0532ca0b1147f0707e78cbcd13b1c8073
6
+ metadata.gz: e1d5d20d2ad29dbd04f755d0a55cb70b7854226c80b8de32578d17c8362c757804023ef7fcc43e14953cb5a4de3b6e58ce0980b73f39c004b8a791bf13ae76ff
7
+ data.tar.gz: 8d23bcda7a90374ebfdd85ad658a0f5304421abce45d6d0017da1347209e0ec7215fc657ce5472f5b963a077a3e9ca5ff60cac2d47918d5beeee2706a4c8f5ae
@@ -36,13 +36,16 @@ end
36
36
  # StackDriver wants an instance_id
37
37
  def instance_id
38
38
  output = IO.popen('/opt/aws/bin/ec2-metadata -i')
39
- output.readlines.first.split[1]
39
+ instance = output.readlines.first.split[1]
40
40
  output.close
41
+ instance
41
42
  rescue
42
43
  "localhost"
43
44
  end
44
45
 
45
46
  # begin
47
+ instance = instance_id
48
+
46
49
  runner.execute do |options|
47
50
  server = "#{options['host']}:#{options['port']}"
48
51
  StackDriver.init options['stackdriver_api_key']
@@ -53,7 +56,7 @@ runner.execute do |options|
53
56
  beanstalkd_stats = connection.stats
54
57
 
55
58
  options['stats'].each do |m|
56
- stat = Stat.new instance_id, m
59
+ stat = Stat.new instance, m
57
60
  stat.value = beanstalkd_stats[m] || 0
58
61
  stats << stat.to_hash
59
62
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beanstalkd-stats
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jorge Moratilla