Class: Copian::Collector::PortStatsCollector

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

Overview

:nodoc:

Instance Method Summary collapse

Constructor Details

#initialize(manager) ⇒ PortStatsCollector

Returns a new instance of PortStatsCollector.



4
5
6
7
# File 'lib/copian/collector/port_stats_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
16
17
# File 'lib/copian/collector/port_stats_collector.rb', line 8

def collect
  load_mtu
  load_speed
  load_oper_status
  load_admin_status

  @interfaces.each do |ifindex, p|
    yield ifindex, p[:mtu], p[:speed], p[:admin_status], p[:oper_status]
  end
end