Class: SpeedGun::Profiler::ActiveRecord

Inherits:
Base
  • Object
show all
Defined in:
lib/speed_gun/profiler/active_record.rb

Instance Attribute Summary

Attributes inherited from Base

#backtrace, #elapsed_time, #id, #parent_profile_id

Instance Method Summary collapse

Methods inherited from Base

#as_msgpack, hook_method, inherited, #initialize, label, #label, load, #measure, profile, #profile, profiler_type, #to_msgpack, #type

Constructor Details

This class inherits a constructor from SpeedGun::Profiler::Base

Instance Method Details

#before_profile(adapter, sql, name = nil) ⇒ Object



12
13
14
15
# File 'lib/speed_gun/profiler/active_record.rb', line 12

def before_profile(adapter, sql, name = nil)
  @sql = sql
  @name = name
end

#htmlObject



8
9
10
# File 'lib/speed_gun/profiler/active_record.rb', line 8

def html
  %Q{<pre class="sql">#{@sql}</pre>}
end

#titleObject



4
5
6
# File 'lib/speed_gun/profiler/active_record.rb', line 4

def title
  "#{@name}"
end