Sha256: 31bebc8a2316d0c5927ba8978fbadfba88696a68e19f54556173823aebea7ae6
Contents?: true
Size: 751 Bytes
Versions: 19
Compression:
Stored size: 751 Bytes
Contents
require 'statsd' module Napa class Stats class << self def emitter=(emitter) @emitter = emitter end def emitter unless @emitter # Log an error if StatsD settings are not configured message = 'StatsD host and port not configured in environment variables, using default settings' Napa::Logger.logger.warn message unless ENV['STATSD_HOST'] && ENV['STATSD_PORT'] # Create a new StatsD emitter with the service name as the namespace # Defaults to localhost port 8125 if env vars are nil @emitter = Statsd.new(ENV['STATSD_HOST'], ENV['STATSD_PORT']).tap { |sd| sd.namespace = Napa::Identity.name } end @emitter end end end end
Version data entries
19 entries across 19 versions & 1 rubygems