Sha256: 18c5be2eb300dc68d3f355acb38e7fe8a815484e76248a48c3ef71fd263038ec
Contents?: true
Size: 801 Bytes
Versions: 15
Compression:
Stored size: 801 Bytes
Contents
module RailsPerformance module Gems module CustomExtension extend self def measure(tag_name, namespace_name = nil) return yield unless RailsPerformance.enabled begin now = Time.now status = 'success' result = yield result rescue Exception => ex status = 'error' raise(ex) ensure RailsPerformance::Models::CustomRecord.new( tag_name: tag_name, namespace_name: namespace_name, status: status, duration: (Time.now - now) * 1000, datetime: now.strftime(RailsPerformance::FORMAT), datetimei: now.to_i, ).save result end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems