Sha256: bfc3f76268ef274af7975a8fcb0c5e5a8f5ea8a4313cd14074d394d9cdd45c90

Contents?: true

Size: 398 Bytes

Versions: 5

Compression:

Stored size: 398 Bytes

Contents

module BloatCheck
  module WrapRequests
    def self.included(klass)
      klass.class_eval do
        before_filter :init_bloat_stats
        after_filter :dump_bloat_stats
      end
    end

    def init_bloat_stats
      @bloat_start = Stats.get
    end

    def dump_bloat_stats
      (Stats.get - @bloat_start).log("REQ=#{request.method.inspect} URL=#{request.url.inspect}")
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
bloat_check-0.0.5 lib/bloat_check/wrap_requests.rb
bloat_check-0.0.4 lib/bloat_check/wrap_requests.rb
bloat_check-0.0.3 lib/bloat_check/wrap_requests.rb
bloat_check-0.0.2 lib/bloat_check/wrap_requests.rb
bloat_check-0.0.1 lib/bloat_check/wrap_requests.rb