red_cross 0.2.13 → 0.2.14
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/red_cross/resque/plugins/red_cross_monitor.rb +6 -4
- data/lib/red_cross/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e4b4f06dcded53b8790298ea43dee10c413b3dd
|
4
|
+
data.tar.gz: 90d0a731c01730e2cdb90579faca4ce04d474923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 96cf40eb35b443ed47b96eb376a709377cb506ce69e853ee898ac1ebd3441fc5b328185391af90abeb281f5f99ede562e87259955bab525f354d8702ded25c55
|
7
|
+
data.tar.gz: caa5f4ff5d91def610a390f7800622e0440b3fa230d79116df100311acb65669a18c4e016425a6e8b1a5d1e2a8a236a22f87ad207dc989f8c9b592b20553e02b
|
@@ -39,9 +39,9 @@ module Resque
|
|
39
39
|
send_metrics('performed', *args)
|
40
40
|
end
|
41
41
|
|
42
|
-
def on_failure_send_monitor_data(
|
42
|
+
def on_failure_send_monitor_data(*args)
|
43
43
|
@job_end_time = Time.now()
|
44
|
-
send_metrics('failed', *args
|
44
|
+
send_metrics('failed', *args)
|
45
45
|
end
|
46
46
|
|
47
47
|
def default_event_properties(*args)
|
@@ -56,10 +56,12 @@ module Resque
|
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
59
|
-
def send_metrics(job_status, *args
|
59
|
+
def send_metrics(job_status, *args)
|
60
60
|
default_event_properties(*args)
|
61
61
|
@event_properties[:fields][:run_time] = ((@job_end_time - @job_start_time)*1000).to_i if %w(performed failed).include? job_status
|
62
|
-
|
62
|
+
if args.is_a?(Array) && args[0].is_a?(Exception)
|
63
|
+
@event_properties[:exception] = args.shift.class.to_s
|
64
|
+
end
|
63
65
|
::RedCross.monitor_track(event: 'resque', properties: @event_properties.merge({ job_status: job_status }))
|
64
66
|
end
|
65
67
|
end
|
data/lib/red_cross/version.rb
CHANGED