resque_to_cloudwatch 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e688f02a4e8350b45d45cbb941e1730695fce9e7
4
- data.tar.gz: 97bd4396f9274ede34bea4a61de46107379bf51a
3
+ metadata.gz: 90778b82350fe90c8075debd74da49daa9e46c8e
4
+ data.tar.gz: 3242faefb11ae2f270b83ece04a2db40feece446
5
5
  SHA512:
6
- metadata.gz: 8d350622314c3713b29f232b9dab78ff3629e0ced410c15aa86eef5f7257845b3a58fa617e92d7b12ad31c160ed765b0bff9e05a611eb3c56a4574cc253f744a
7
- data.tar.gz: 91f2c68bf7607025efd1bedd4c7cae82eaf2395cdbaabccbcdde34df48bfed5146d8b2b19358b4032be7733840c768990ef20a7166ec86de02b5fb098f8f230d
6
+ metadata.gz: 51dd3b8133a91a266afc68348c081365d9f89c1b8386a6f79a2797252c27f99889e20666aa9ce2ab7b10868b7700160d5cc10c6a31e1669f1cff383de331b909
7
+ data.tar.gz: b910d345e31326f3b72e247c47fd0c430730df0017279f06ba9862f52593471fc5c28c605752d63b0d87ebaff039a487266c3a2c0f3bb1d01534be72da441e57
@@ -9,21 +9,15 @@ module ResqueToCloudwatch
9
9
  end
10
10
 
11
11
  def send_value(value, metric_name)
12
+ dimensions = []
13
+ dimensions << {:name => 'project', :value => @config.project}
14
+ dimensions << {:name => 'hostname', :value => @config.hostname} unless @config.hostname.nil?
12
15
  cw = AWS::CloudWatch.new
13
16
  cw.client.put_metric_data({
14
17
  :namespace => "#{@config.namespace}/resque",
15
18
  :metric_data => [
16
19
  :metric_name => metric_name,
17
- :dimensions => [
18
- {
19
- :name => 'hostname',
20
- :value => @config.hostname
21
- },
22
- {
23
- :name => 'project',
24
- :value => @config.project
25
- }
26
- ],
20
+ :dimensions => dimensions,
27
21
  :value => value,
28
22
  :unit => 'Count'
29
23
  ]
@@ -12,7 +12,7 @@ module ResqueToCloudwatch
12
12
  def initialize(path)
13
13
  $log.info "Loading configuration"
14
14
  raise "Config file #{path} not found or readable" unless File.exists?(path)
15
- @required_opts = %w{access_key_id secret_access_key project period region redis_host redis_port hostname namespace}
15
+ @required_opts = %w{access_key_id secret_access_key project period region redis_host redis_port namespace}
16
16
  @hash = YAML.load_file(path)
17
17
  raise "Config file #{path} is empty" unless @hash
18
18
  validate_config
@@ -1,3 +1,3 @@
1
1
  module ResqueToCloudwatch
2
- VERSION = "1.2.1"
2
+ VERSION = "1.3.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque_to_cloudwatch
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andy Sykes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-01-14 00:00:00.000000000 Z
11
+ date: 2014-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler