class Rack::StatsdBatch

Public Class Methods

new(rack_app, hostname, port, mtu=1432) click to toggle source
# File lib/rack/statsd_batch.rb, line 5
def initialize rack_app, hostname, port, mtu=1432
  @app = rack_app
  @hostname = hostname
  @port = port
  @mtu = mtu
end

Public Instance Methods

call(env) click to toggle source
# File lib/rack/statsd_batch.rb, line 12
def call env
  env['metrics'] = Rack::StatsdBatch::Recorder.new
  status, headers, response = @app.call(env)
  env['metrics'].publish(@hostname, @port, @mtu)
  [status, headers, response]
end