statsd-client 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/statsd.rb +9 -4
- metadata +2 -2
data/lib/statsd.rb
CHANGED
@@ -2,7 +2,7 @@ require 'socket'
|
|
2
2
|
|
3
3
|
class Statsd
|
4
4
|
|
5
|
-
Version = '0.0.
|
5
|
+
Version = '0.0.3'
|
6
6
|
|
7
7
|
class << self
|
8
8
|
|
@@ -50,9 +50,14 @@ class Statsd
|
|
50
50
|
|
51
51
|
raise "host and port must be set" unless host && port
|
52
52
|
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
begin
|
54
|
+
sock = UDPSocket.new
|
55
|
+
data.each do |d|
|
56
|
+
sock.send(d, 0, host, port)
|
57
|
+
end
|
58
|
+
rescue # silent but deadly
|
59
|
+
ensure
|
60
|
+
sock.close
|
56
61
|
end
|
57
62
|
true
|
58
63
|
end
|