Sha256: 7b3d1cecc32ad8a411e0c32f3751edb678010f6012f1b018824b92daae95a5d3
Contents?: true
Size: 837 Bytes
Versions: 7
Compression:
Stored size: 837 Bytes
Contents
module RailsPerformance class CurrentRequest attr_reader :request_id, :tracings, :ignore attr_accessor :data attr_accessor :record def self.init Thread.current[:rp_current_request] ||= CurrentRequest.new(SecureRandom.hex(16)) end def self.current CurrentRequest.init end def self.cleanup RailsPerformance.log "----------------------------------------------------> CurrentRequest.cleanup !!!!!!!!!!!! -------------------------\n\n" RailsPerformance.skip = false Thread.current[:rp_current_request] = nil end def initialize(request_id) @request_id = request_id @tracings = [] @ignore = Set.new @data = nil @record = nil end def trace(options = {}) @tracings << options.merge(time: Time.current.to_i) end end end
Version data entries
7 entries across 7 versions & 1 rubygems