Module: Sapience::Extensions::Grape::Timings
Instance Method Summary collapse
- #append_db_runtime(event) ⇒ Object
- #db_runtime ⇒ Object
- #db_runtime=(value) ⇒ Object
- #reset_db_runtime ⇒ Object
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_runtime ⇒ Object
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_runtime ⇒ Object
16 17 18 |
# File 'lib/sapience/extensions/grape/timings.rb', line 16 def reset_db_runtime self.db_runtime = 0 end |