lib/instrumental/agent.rb in instrumental_agent-0.12.2 vs lib/instrumental/agent.rb in instrumental_agent-0.12.3
- old
+ new
@@ -38,17 +38,17 @@
options.replace(
options.inject({}) { |m, (k, v)| m[(k.to_sym rescue k) || k] = v; m }
)
# defaults
- # host: instrumentalapp.com
+ # host: collector.instrumentalapp.com
# port: 8000
# enabled: true
# synchronous: false
@api_key = api_key
@host, @port = options[:collector].to_s.split(':')
- @host ||= 'instrumentalapp.com'
+ @host ||= 'collector.instrumentalapp.com'
@port = (@port || 8000).to_i
@enabled = options.has_key?(:enabled) ? !!options[:enabled] : true
@synchronous = !!options[:synchronous]
@pid = Process.pid
@allow_reconnect = true
@@ -237,14 +237,14 @@
def report_exception(e)
logger.error "Exception occurred: #{e.message}\n#{e.backtrace.join("\n")}"
end
def send_command(cmd, *args)
+ cmd = "%s %s\n" % [cmd, args.collect { |a| a.to_s }.join(" ")]
if enabled?
start_connection_worker if !running?
- cmd = "%s %s\n" % [cmd, args.collect { |a| a.to_s }.join(" ")]
if @queue.size < MAX_BUFFER
@queue_full_warning = false
logger.debug "Queueing: #{cmd.chomp}"
queue_message(cmd, { :synchronous => @synchronous })
else
@@ -253,9 +253,11 @@
logger.warn "Queue full(#{@queue.size}), dropping commands..."
end
logger.debug "Dropping command, queue full(#{@queue.size}): #{cmd.chomp}"
nil
end
+ else
+ logger.debug cmd.strip
end
end
def queue_message(message, options = {})
if @enabled