resque-honey 1.2.1 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0a6bddd851a04aad791ee0357c9331dafe1b1bcd24aed7111a2e309d2fc9bce3
4
- data.tar.gz: cca8fec10f76dd1f06ba68e12c8014c67650230d05f126f0b02b1210cee9e06e
3
+ metadata.gz: 98bc959c4356bb8d500b6c6f484a15e503755a368d118abb031ca03dddcc702a
4
+ data.tar.gz: b2c6eb50b14ea09e02d41cea69f214423005b7330991fddd416c2b9d1f30c394
5
5
  SHA512:
6
- metadata.gz: 99737d1d7fbf28eb52813b37536821942028907cea93ac6e77b25acbcff187d37ff88d64a492c6c0c14320aaa7bb014b1c13f0bfc85daae427e0d30ab5adfe9f
7
- data.tar.gz: 375340ff1e61ebe72b10ef0350b348d542b4e1f6da9b25fc45569ec0a9dbb3e8583cd23d944f0c5ee8702e8f50a9899a131a5c074413fd0233c91dcdfa36a5c5
6
+ metadata.gz: a12faaa3c48af2b4a1bf5176e011cdbc79245a4cf0dca5d52de85a3771653aae797d64d55b9d397fb1c09d40716c3056cfc49ea9d35e0ca620b65db9b94e5f19
7
+ data.tar.gz: 277758b7cbb7dfae8d6b501fa161a870c4e59bc48a995d892290b36fd5eeaa6481b5bae4af4f56c8032d8634b89bcaedb643c82e88f891d8fc98648051c32677
@@ -0,0 +1 @@
1
+ 2.5.0
@@ -1,3 +1,4 @@
1
1
  require 'libhoney'
2
2
  require 'resque/plugins/honey/version'
3
3
  require 'resque/plugins/honey'
4
+ require 'resque/plugins/datadog'
@@ -0,0 +1,38 @@
1
+ module Resque
2
+ module Plugins
3
+ module Datadog
4
+ mattr_accessor :statsd
5
+ mattr_accessor :service_name
6
+
7
+ def around_perform_datadog(*args)
8
+ return yield unless statsd
9
+
10
+ exc = nil
11
+ result = nil
12
+ start_time = Time.now
13
+ begin
14
+ result = yield
15
+ rescue => e
16
+ exc = e
17
+ end
18
+ end_time = Time.now
19
+
20
+ tags = [
21
+ "job_class:#{self.name.to_s}",
22
+ "queue:#{@queue.to_s}"
23
+ ]
24
+ tags << "service:#{service_name}" if service_name.present?
25
+ tags = tags.concat(dd_tags(*args)).uniq if respond_to?(:dd_tags)
26
+
27
+ statsd.batch do |s|
28
+ s.increment('resque.jobs.total', tags: tags)
29
+ s.increment("resque.jobs.#{exc.nil? ? 'success' : 'failure'}", tags: tags)
30
+ s.timing('resque.jobs.duration', (end_time - start_time) * 1000, tags: tags)
31
+ end
32
+
33
+ raise exc if exc
34
+ result
35
+ end
36
+ end
37
+ end
38
+ end
@@ -1,7 +1,7 @@
1
1
  module Resque
2
2
  module Plugins
3
3
  module Honey
4
- VERSION = '1.2.1'.freeze
4
+ VERSION = '1.3.0'.freeze
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: resque-honey
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
  - Trae Robrock
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-03-12 00:00:00.000000000 Z
11
+ date: 2018-07-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libhoney
@@ -60,6 +60,7 @@ extensions: []
60
60
  extra_rdoc_files: []
61
61
  files:
62
62
  - ".gitignore"
63
+ - ".ruby-version"
63
64
  - Gemfile
64
65
  - LICENSE.txt
65
66
  - README.md
@@ -67,6 +68,7 @@ files:
67
68
  - bin/console
68
69
  - bin/setup
69
70
  - lib/resque-honey.rb
71
+ - lib/resque/plugins/datadog.rb
70
72
  - lib/resque/plugins/honey.rb
71
73
  - lib/resque/plugins/honey/version.rb
72
74
  - resque-honey.gemspec