# File lib/thin/stats.rb, line 9 9: def initialize(app, path='/stats') 10: @app = app 11: @path = path 12: 13: @template = ERB.new(File.read(File.dirname(__FILE__) + '/stats.html.erb')) 14: 15: @requests = 0 16: @requests_finished = 0 17: @start_time = Time.now 18: end
# File lib/thin/stats.rb, line 20 20: def call(env) 21: if env['PATH_INFO'].index(@path) == 0 22: serve(env) 23: else 24: log(env) { @app.call(env) } 25: end 26: end
# File lib/thin/stats.rb, line 28 28: def log(env) 29: @requests += 1 30: @last_request = Rack::Request.new(env) 31: request_started_at = Time.now 32: 33: response = yield 34: 35: @requests_finished += 1 36: @last_request_time = Time.now - request_started_at 37: 38: response 39: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.