Module: Sapience::Extensions::Grape::Timings

Extended by:
Timings
Included in:
Timings
Defined in:
lib/sapience/extensions/grape/timings.rb

Instance Method Summary collapse

Instance Method Details

#append_db_runtime(event) ⇒ Object



20
21
22
# File 'lib/sapience/extensions/grape/timings.rb', line 20

def append_db_runtime(event)
  self.db_runtime += event.duration
end

#db_runtimeObject



12
13
14
# File 'lib/sapience/extensions/grape/timings.rb', line 12

def db_runtime
  Thread.current[:grape_db_runtime] ||= 0
end

#db_runtime=(value) ⇒ Object



8
9
10
# File 'lib/sapience/extensions/grape/timings.rb', line 8

def db_runtime=(value)
  Thread.current[:grape_db_runtime] = value
end

#reset_db_runtimeObject



16
17
18
# File 'lib/sapience/extensions/grape/timings.rb', line 16

def reset_db_runtime
  self.db_runtime = 0
end