Sha256: 179a026d0a348ed61972f047627992c1e73b3bb3b83e87f9cd5d59a8986f0a49
Contents?: true
Size: 567 Bytes
Versions: 15
Compression:
Stored size: 567 Bytes
Contents
module Rhosync module Stats class Middleware def initialize(app) @app = app end def call(env) start = Time.now.to_f status, headers, body = @app.call(env) finish = Time.now.to_f metric = "http:#{env['REQUEST_METHOD']}:#{env['PATH_INFO']}" source_name = env['rack.request.query_hash']["source_name"] if env['rack.request.query_hash'] metric << ":#{source_name}" if source_name Record.save_average(metric,finish - start) [status, headers, body] end end end end
Version data entries
15 entries across 15 versions & 1 rubygems