Sha256: 3954ba629235d3bae61f2f8d540f2485316eaec86146af014c9eb0ff1a1e1bd9

Contents?: true

Size: 502 Bytes

Versions: 8

Compression:

Stored size: 502 Bytes

Contents

# frozen_string_literal: true
module Sapience
  module Extensions
    module Sinatra
      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
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
sapience-3.0 lib/sapience/extensions/sinatra/timings.rb
sapience-2.15 lib/sapience/extensions/sinatra/timings.rb
sapience-2.14 lib/sapience/extensions/sinatra/timings.rb
sapience-2.13 lib/sapience/extensions/sinatra/timings.rb
sapience-2.12 lib/sapience/extensions/sinatra/timings.rb
sapience-2.11 lib/sapience/extensions/sinatra/timings.rb
sapience-2.10 lib/sapience/extensions/sinatra/timings.rb
sapience-2.9.1 lib/sapience/extensions/sinatra/timings.rb