Module: BloatCheck::WrapRequests

Defined in:
lib/bloat_check/wrap_requests.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(klass) ⇒ Object



3
4
5
6
7
8
# File 'lib/bloat_check/wrap_requests.rb', line 3

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

Instance Method Details

#dump_bloat_statsObject



14
15
16
# File 'lib/bloat_check/wrap_requests.rb', line 14

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

#init_bloat_statsObject



10
11
12
# File 'lib/bloat_check/wrap_requests.rb', line 10

def init_bloat_stats
  @bloat_start = Stats.get
end