Module: Profiler

Defined in:
lib/profiler.rb,
lib/profiler/result.rb,
lib/profiler/profile.rb,
lib/profiler/version.rb,
lib/profiler/printers/flat_printer.rb,
lib/profiler/printers/abstract_printer.rb

Defined Under Namespace

Classes: AbstractPrinter, FlatPrinter, Profile, Result

Constant Summary collapse

VERSION =
'0.0.2'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.is_pausedObject

Returns the value of attribute is_paused.



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

def is_paused
  @is_paused
end

.profileObject

Returns the value of attribute profile.



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

def profile
  @profile
end

Class Method Details

.check(caller_offset = 0) ⇒ Object



23
24
25
26
# File 'lib/profiler.rb', line 23

def check(caller_offset=0)
  return if is_paused
  profile.check(caller_offset)
end

.pauseObject



15
16
17
# File 'lib/profiler.rb', line 15

def pause
  self.is_paused = true
end

.resumeObject



19
20
21
# File 'lib/profiler.rb', line 19

def resume
  self.is_paused = false
end

.startObject



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

def start
  self.profile = Profile.new
  self.is_paused = false
end

.stopObject



28
29
30
# File 'lib/profiler.rb', line 28

def stop
  profile.stop
end