Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit

Permalink
Add optional ports
Browse files Browse the repository at this point in the history
  • Loading branch information
vmg committed Jan 20, 2015
1 parent affe1b9 commit 116c12e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/statsd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def initialize(host, port=8125, key=nil)
add_host(host, port, key)
end

def add_host(host, port, key = nil)
@hosts << Host.new(host, port, key)
def add_host(host, port = nil, key = nil)
host, port = host.split(':') if host.include?(':')
@hosts << Host.new(host, port.to_i, key)
end

# Sends an increment (count = 1) for the given stat to the statsd server.
Expand Down

0 comments on commit 116c12e

Please sign in to comment.