Sha256: 8752758ae7e44391426c6ff87d36dbb2d8b796d23c728226f2a7e163d1ff6ec9

Contents?: true

Size: 356 Bytes

Versions: 2

Compression:

Stored size: 356 Bytes

Contents

require 'statsd-ruby'

module StatsWhisper::Backend

  class StatsD

    extend Forwardable

    def_delegators :@statsd, :increment, :timing

    def initialize
      @statsd = Statsd.new(hostname, port)
    end

    def hostname
      ENV['STATSWHISPER_HOST'] || 'localhost'
    end

    def port
      ENV['STATSWHISPER_PORT'] || 8125
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
stats_whisper-0.2.3 lib/stats_whisper/backend/statsd.rb
stats_whisper-0.2.2.1 lib/stats_whisper/backend/statsd.rb