Module: GrapeLogging::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
17 18 19 |
# File 'lib/grape_logging/timings.rb', line 17 def append_db_runtime(event) self.db_runtime += event.duration end |
#db_runtime ⇒ Object
9 10 11 |
# File 'lib/grape_logging/timings.rb', line 9 def db_runtime Thread.current[:grape_db_runtime] ||= 0 end |
#db_runtime=(value) ⇒ Object
5 6 7 |
# File 'lib/grape_logging/timings.rb', line 5 def db_runtime=(value) Thread.current[:grape_db_runtime] = value end |
#reset_db_runtime ⇒ Object
13 14 15 |
# File 'lib/grape_logging/timings.rb', line 13 def reset_db_runtime self.db_runtime = 0 end |