Class: EventMachine::SFlow::FlowSample
- Inherits:
-
Object
- Object
- EventMachine::SFlow::FlowSample
- Defined in:
- lib/em-sflow/packet/flow_sample.rb
Instance Attribute Summary collapse
-
#drop_count ⇒ Object
Returns the value of attribute drop_count.
-
#input_count ⇒ Object
Returns the value of attribute input_count.
-
#output_count ⇒ Object
Returns the value of attribute output_count.
-
#records ⇒ Object
Returns the value of attribute records.
-
#sample_pool ⇒ Object
Returns the value of attribute sample_pool.
-
#sampling_rate ⇒ Object
Returns the value of attribute sampling_rate.
-
#sequence_number ⇒ Object
Returns the value of attribute sequence_number.
-
#source_class ⇒ Object
Returns the value of attribute source_class.
-
#source_value ⇒ Object
Returns the value of attribute source_value.
Instance Method Summary collapse
-
#initialize(data) ⇒ FlowSample
constructor
A new instance of FlowSample.
Constructor Details
#initialize(data) ⇒ FlowSample
Returns a new instance of FlowSample.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 4 def initialize data data.extend EM::SFlow::BinaryString data.extend EM::SFlow::FlowRecord @records = [] @sequence_number, source_id_class_value, @sampling_rate, @sample_pool, @drop_count, @input_count, @output_count, record_count = data.unpack("NNNNNNNN") @source_class = source_id_class_value >> 24 @source_value = source_id_class_value & (2 ** 24 - 1) data.advance(32) @records = data.to_flow_records!(record_count) end |
Instance Attribute Details
#drop_count ⇒ Object
Returns the value of attribute drop_count.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def drop_count @drop_count end |
#input_count ⇒ Object
Returns the value of attribute input_count.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def input_count @input_count end |
#output_count ⇒ Object
Returns the value of attribute output_count.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def output_count @output_count end |
#records ⇒ Object
Returns the value of attribute records.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def records @records end |
#sample_pool ⇒ Object
Returns the value of attribute sample_pool.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def sample_pool @sample_pool end |
#sampling_rate ⇒ Object
Returns the value of attribute sampling_rate.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def sampling_rate @sampling_rate end |
#sequence_number ⇒ Object
Returns the value of attribute sequence_number.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def sequence_number @sequence_number end |
#source_class ⇒ Object
Returns the value of attribute source_class.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def source_class @source_class end |
#source_value ⇒ Object
Returns the value of attribute source_value.
2 3 4 |
# File 'lib/em-sflow/packet/flow_sample.rb', line 2 def source_value @source_value end |