Class: SpeedGun::Profiler::Js

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

Instance Attribute Summary collapse

Attributes inherited from Base

#backtrace, #elapsed_time, #id, #parent_profile_id

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

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

Instance Attribute Details

#titleObject (readonly)

Returns the value of attribute title.



10
11
12
# File 'lib/speed_gun/profiler/js.rb', line 10

def title
  @title
end

Class Method Details

.profile(profiler, title, elapsed_time, backtrace) ⇒ Object



4
5
6
7
8
# File 'lib/speed_gun/profiler/js.rb', line 4

def self.profile(profiler, title, elapsed_time, backtrace)
  profile = new
  profiler.profiles << profile
  profile.save(title, elapsed_time, backtrace)
end

Instance Method Details

#save(title, elapsed_time, backtrace) ⇒ Object



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

def save(title, elapsed_time, backtrace)
  @title = title.to_s
  @elapsed_time = elapsed_time.to_i * 0.001
  @backtrace = backtrace
end