resque-honey 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 +4 -4
- data/.ruby-version +1 -0
- data/lib/resque-honey.rb +1 -0
- data/lib/resque/plugins/datadog.rb +38 -0
- data/lib/resque/plugins/honey/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98bc959c4356bb8d500b6c6f484a15e503755a368d118abb031ca03dddcc702a
|
4
|
+
data.tar.gz: b2c6eb50b14ea09e02d41cea69f214423005b7330991fddd416c2b9d1f30c394
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a12faaa3c48af2b4a1bf5176e011cdbc79245a4cf0dca5d52de85a3771653aae797d64d55b9d397fb1c09d40716c3056cfc49ea9d35e0ca620b65db9b94e5f19
|
7
|
+
data.tar.gz: 277758b7cbb7dfae8d6b501fa161a870c4e59bc48a995d892290b36fd5eeaa6481b5bae4af4f56c8032d8634b89bcaedb643c82e88f891d8fc98648051c32677
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.0
|
data/lib/resque-honey.rb
CHANGED
@@ -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
|
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.
|
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-
|
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
|