Class: Copian::Collector::BandwidthCollector

Inherits:
AbstractCollector show all
Defined in:
lib/copian/collector/bandwidth_collector.rb

Overview

:nodoc:

Instance Method Summary collapse

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

#collectObject



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

#collect64Object



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