Sha256: bdcc1458404c55cb9cd7c4c97c8252890a7451e30e87dfd6a7e5fec3a5ccc6ab
Contents?: true
Size: 710 Bytes
Versions: 1
Compression:
Stored size: 710 Bytes
Contents
require 'logger' require 'benchmark' module ResqueMods module LoggedJob def around_perform_log_job(*args) clazz = self.name ResqueMods.logger.info "#{clazz} starting up with: #{args.join(", ")}" begin run_time = Benchmark.realtime do yield *args end rescue => e ResqueMods.logger.info "#{clazz} completed unsuccessfully in #{run_time.round unless run_time.nil?} seconds with #{e.class}:#{e.message}" raise end Librato.measure("resque_mods.logged_job.#{clazz}.run_time", "%f" % run_time) ResqueMods.logger.info "#{clazz} completed successfully in #{run_time.round unless run_time.nil?} seconds" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
resque-mods-1.0.2 | lib/resque-mods/logged_job.rb |