sidekiq-ichnite 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sidekiq-ichnite/middleware.rb +16 -11
- data/lib/sidekiq-ichnite/version.rb +1 -1
- data/sidekiq-ichnite.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 68591c277ba356fbc271dd1d9b041665fce8cf80
|
4
|
+
data.tar.gz: ebbab5a28c9649a1da3c893bd639d8b5e9ee9968
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a22c12c4d0f144ad9bb7b237b98484a178dc0fd45c8e4648e1dbeb92716550f6a96d28a625f4aa99bcf500eb43b211798c3b0af07cdc167cccfbb79692a87bb
|
7
|
+
data.tar.gz: 04d1c3577ae37fe5f125593e6cb3cc644cfd710ea3bdb5500f0b62be7d13e8b6c5474436c8fbf44839fd566fddb7a153e78e25d82169ebbd722992df1cf87e53
|
@@ -65,7 +65,7 @@ module Sidekiq
|
|
65
65
|
yield
|
66
66
|
stop context, msg, ts
|
67
67
|
rescue => ex
|
68
|
-
error context, ex, ts
|
68
|
+
error context, msg, ex, ts
|
69
69
|
raise ex
|
70
70
|
end
|
71
71
|
end
|
@@ -75,25 +75,30 @@ module Sidekiq
|
|
75
75
|
::Ichnite.log('job_start', context)
|
76
76
|
end
|
77
77
|
|
78
|
-
def error(context, error, start)
|
79
|
-
data = context.merge(
|
78
|
+
def error(context, msg, error, start)
|
79
|
+
data = context.merge(job_timing(msg, start))
|
80
|
+
data.merge!(
|
80
81
|
at: :error,
|
81
|
-
duration: duration_ms(start),
|
82
82
|
error: error.class.name,
|
83
83
|
message: error.message[/\A.+$/].inspect)
|
84
84
|
::Ichnite.log('job_error', data)
|
85
85
|
end
|
86
86
|
|
87
|
-
def stop(context,
|
88
|
-
data = context.merge(
|
89
|
-
# It looks like this number is subject to clock drift.
|
90
|
-
# TODO: Figure out a way to make this accurate.
|
91
|
-
# queued_duration: duration_ms(msg['enqueued_at'], start),
|
92
|
-
duration: duration_ms(start))
|
93
|
-
|
87
|
+
def stop(context, msg, start)
|
88
|
+
data = context.merge(job_timing(msg, start))
|
94
89
|
::Ichnite.log('job_stop', data)
|
95
90
|
end
|
96
91
|
|
92
|
+
def job_timing(msg, start)
|
93
|
+
# with clock drift this number can become negative.
|
94
|
+
# Let's take 0 in this case.
|
95
|
+
queued_duration = [0, duration_ms(msg['enqueued_at'], start)].max
|
96
|
+
{
|
97
|
+
queued_for: queued_duration / 1000,
|
98
|
+
duration: duration_ms(start)
|
99
|
+
}
|
100
|
+
end
|
101
|
+
|
97
102
|
def duration_ms(from, to = Time.now.to_f)
|
98
103
|
((to - from) * 1000).round
|
99
104
|
end
|
data/sidekiq-ichnite.gemspec
CHANGED
@@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
22
|
spec.require_paths = ["lib"]
|
23
23
|
|
24
|
-
spec.add_dependency "ichnite", '>= 0.0.
|
24
|
+
spec.add_dependency "ichnite", '>= 0.0.5'
|
25
25
|
spec.add_dependency "sidekiq"
|
26
26
|
|
27
27
|
spec.add_development_dependency "bundler", "~> 1.13"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sidekiq-ichnite
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yves Senn
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ichnite
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.0.
|
19
|
+
version: 0.0.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.0.
|
26
|
+
version: 0.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|