mirror of
https://github.com/samsonjs/grape_logging.git
synced 2026-04-13 12:05:47 +00:00
21 lines
No EOL
362 B
Ruby
21 lines
No EOL
362 B
Ruby
module GrapeLogging
|
|
module Timings
|
|
extend self
|
|
|
|
def db_runtime=(value)
|
|
Thread.current[:grape_db_runtime] = value
|
|
end
|
|
|
|
def db_runtime
|
|
Thread.current[:grape_db_runtime] ||= 0
|
|
end
|
|
|
|
def reset_db_runtime
|
|
self.db_runtime = 0
|
|
end
|
|
|
|
def append_db_runtime(event)
|
|
self.db_runtime += event.duration
|
|
end
|
|
end
|
|
end |