Class: Copian::Collector::BandwidthCollector
- Inherits:
-
AbstractCollector
- Object
- AbstractCollector
- Copian::Collector::BandwidthCollector
- Defined in:
- lib/copian/collector/bandwidth_collector.rb
Overview
:nodoc:
Instance Method Summary collapse
- #collect ⇒ Object
- #collect64 ⇒ Object
-
#initialize(manager) ⇒ BandwidthCollector
constructor
A new instance of BandwidthCollector.
Constructor Details
#initialize(manager) ⇒ BandwidthCollector
Returns a new instance of BandwidthCollector.
4 5 6 7 |
# File 'lib/copian/collector/bandwidth_collector.rb', line 4 def initialize(manager) super(manager) @interfaces = Hash.new end |
Instance Method Details
#collect ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/copian/collector/bandwidth_collector.rb', line 8 def collect load_inoctets load_outoctets @interfaces.each do |ifindex, stats| yield ifindex, stats[:inoctets], stats[:outoctets] end end |
#collect64 ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/copian/collector/bandwidth_collector.rb', line 16 def collect64 load_inoctets64 load_outoctets64 @interfaces.each do |ifindex, stats| yield ifindex, stats[:inoctets64], stats[:outoctets64] end end |