equal
deleted
inserted
replaced
13 |
13 |
14 -- Create UDP socket to statsd server |
14 -- Create UDP socket to statsd server |
15 local sock = socket.udp() |
15 local sock = socket.udp() |
16 sock:setpeername(options.hostname or "127.0.0.1", options.port or 8125) |
16 sock:setpeername(options.hostname or "127.0.0.1", options.port or 8125) |
17 |
17 |
18 -- Metrics are namespaced by ".", and seperated by newline |
18 -- Metrics are namespaced by ".", and separated by newline |
19 function clean(s) return (s:gsub("[%.:\n]", "_")) end |
19 function clean(s) return (s:gsub("[%.:\n]", "_")) end |
20 |
20 |
21 -- A 'safer' send function to expose |
21 -- A 'safer' send function to expose |
22 function send(s) return sock:send(s) end |
22 function send(s) return sock:send(s) end |
23 |
23 |