Class: Trema::PortStatsReply

Inherits:
StatsHelper show all
Defined in:
ruby/trema/port-stats-reply.rb

Constant Summary collapse

FIELDS =
%w(port_no rx_packets tx_packets rx_bytes) +
%w(tx_bytes rx_dropped tx_dropped rx_errors tx_errors) +
%w(rx_frame_err rx_over_err rx_crc_err collisions )

Instance Method Summary collapse

Methods inherited from StatsHelper

#to_s

Constructor Details

#initialize(options = {}) ⇒ PortStatsReply

Port counters or errors for one or more physical ports. A user would not explicitly instantiate a Trema::PortStatsReply object but would be created as a result of parsing the OFPT_STATS_REPLY(OFPST_PORT) message.

Returns an object that encapsulates the OFPST_STATS_REPLY(OFPST_PORT) OpenFlow message.

Examples:

PortStatsReply.new(
  :port_no => 1,
  :rx_packets => 7,
  :tx_packets => 10,
  :rx_bytes => 1454,
  :tx_bytes => 2314
  :rx_dropped => 0,
  :tx_dropped => 0,
  :rx_errors => 0,
  :tx_errors => 0,
  :rx_frame_err => 0,
  :rx_over_err => 0,
  :rx_crc_err => 0,
  :collisions => 0
)

Parameters:

  • options (Hash) (defaults to: {})

    the options to create this instance with.

Options Hash (options):

  • :port_no (Number)

    the port_no statistics are reported for.

  • :rx_packets (Number)

    a counter of received packets.

  • :tx_packets (Number)

    a counter of transmitted packets.

  • :rx_bytes (Number)

    a counter of received bytes.

  • :tx_bytes (Number)

    a counter of transmitted bytes.

  • :rx_dropped (Number)

    a counter of received dropped frames.

  • :tx_dropped (Number)

    a counter of transmitted dropped frames.

  • :rx_errors (Number)

    a counter of received errors.

  • :tx_errors (Number)

    a counter of transmitted errors.

  • :rx_frame_err (Number)

    a counter of received frame errors.

  • :rx_over_err (Number)

    a counter of received overrun errors.

  • :rx_crc_err (Number)

    a counter of crc errors.

  • :collisions (Number)

    a counter of detected collisions.



98
99
100
# File 'ruby/trema/port-stats-reply.rb', line 98

def initialize options
  super FIELDS, options
end