Class: FFWD::Plugin::Protobuf::OutputUDP
- Inherits:
-
Handler
- Object
- Handler
- FFWD::Plugin::Protobuf::OutputUDP
- Defined in:
- lib/ffwd/plugin/protobuf.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(connect, config) ⇒ OutputUDP
constructor
A new instance of OutputUDP.
- #send_all(events, metrics) ⇒ Object
- #send_event(event) ⇒ Object
- #send_metric(metric) ⇒ Object
Constructor Details
#initialize(connect, config) ⇒ OutputUDP
Returns a new instance of OutputUDP.
40 41 42 |
# File 'lib/ffwd/plugin/protobuf.rb', line 40 def initialize connect, config @connect = connect end |
Class Method Details
.plugin_type ⇒ Object
36 37 38 |
# File 'lib/ffwd/plugin/protobuf.rb', line 36 def self.plugin_type "protobuf_udp_out" end |
Instance Method Details
#send_all(events, metrics) ⇒ Object
44 45 46 47 48 49 50 51 52 |
# File 'lib/ffwd/plugin/protobuf.rb', line 44 def send_all events, metrics events.each do |event| send_event event end metrics.each do |metric| send_metric metric end end |
#send_event(event) ⇒ Object
54 55 56 |
# File 'lib/ffwd/plugin/protobuf.rb', line 54 def send_event event @connect.send_data Serializer.dump_event(event) end |
#send_metric(metric) ⇒ Object
58 59 60 |
# File 'lib/ffwd/plugin/protobuf.rb', line 58 def send_metric metric @connect.send_data Serializer.dump_metric(metric) end |