Class: MultiStatsd::Server
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- MultiStatsd::Server
- Defined in:
- lib/multi-statsd/server.rb
Overview
Eventmachine connection which receives UDP data and writes it to various backends
Instance Method Summary collapse
-
#initialize(backends = [], *args) ⇒ Server
constructor
Initialize the server with one or more backends.
-
#receive_data(data) ⇒ nil
Write out statsd data to each registered backend.
Constructor Details
#initialize(backends = [], *args) ⇒ Server
Initialize the server with one or more backends
6 7 8 9 |
# File 'lib/multi-statsd/server.rb', line 6 def initialize(backends = [], *args) @backends = [backends].flatten super end |
Instance Method Details
#receive_data(data) ⇒ nil
Write out statsd data to each registered backend
14 15 16 17 18 19 20 |
# File 'lib/multi-statsd/server.rb', line 14 def receive_data(data) @backends.each do |backend| backend.write(data) end nil end |