Class: Vmstat::NetworkInterface
- Inherits:
-
Struct
- Object
- Struct
- Vmstat::NetworkInterface
- Defined in:
- lib/vmstat/network_interface.rb
Overview
Gathered the network interface information.
Constant Summary collapse
- ETHERNET_TYPE =
The type of ethernet devices on freebsd/mac os x
0x06
- LOOPBACK_TYPE =
The type of loopback devices on freebsd/mac os x
0x18
Instance Attribute Summary collapse
-
#in_bytes ⇒ Fixnum
the number od bytes that where received inbound.
-
#in_drops ⇒ Fixnum
the number of drops that where received inbound.
-
#in_errors ⇒ Fixnum
the number of errors that where received inbound.
-
#name ⇒ Symbol
the system name for the network interface.
-
#out_bytes ⇒ Fixnum
the number od bytes that where send outbound.
-
#out_errors ⇒ Fixnum
the number od errors that where send outbound.
-
#type ⇒ Fixnum
the type of the interface (bsd numbers).
Instance Method Summary collapse
-
#ethernet? ⇒ TrueClass, FalseClass
Checks if this network interface is a ethernet device.
-
#loopback? ⇒ TrueClass, FalseClass
Checks if this network interface is a loopback device.
Instance Attribute Details
#in_bytes ⇒ Fixnum
the number od bytes that where received inbound.
10 11 12 |
# File 'lib/vmstat/network_interface.rb', line 10 def in_bytes @in_bytes end |
#in_drops ⇒ Fixnum
the number of drops that where received inbound.
10 11 12 |
# File 'lib/vmstat/network_interface.rb', line 10 def in_drops @in_drops end |
#in_errors ⇒ Fixnum
the number of errors that where received inbound.
10 11 12 |
# File 'lib/vmstat/network_interface.rb', line 10 def in_errors @in_errors end |
#name ⇒ Symbol
the system name for the network interface.
10 11 12 |
# File 'lib/vmstat/network_interface.rb', line 10 def name @name end |
#out_bytes ⇒ Fixnum
the number od bytes that where send outbound.
10 11 12 |
# File 'lib/vmstat/network_interface.rb', line 10 def out_bytes @out_bytes end |
#out_errors ⇒ Fixnum
the number od errors that where send outbound.
10 11 12 |
# File 'lib/vmstat/network_interface.rb', line 10 def out_errors @out_errors end |
#type ⇒ Fixnum
the type of the interface (bsd numbers)
10 11 12 |
# File 'lib/vmstat/network_interface.rb', line 10 def type @type end |
Instance Method Details
#ethernet? ⇒ TrueClass, FalseClass
Checks if this network interface is a ethernet device.
29 30 31 |
# File 'lib/vmstat/network_interface.rb', line 29 def ethernet? type == ETHERNET_TYPE end |
#loopback? ⇒ TrueClass, FalseClass
Checks if this network interface is a loopback device.
22 23 24 |
# File 'lib/vmstat/network_interface.rb', line 22 def loopback? type == LOOPBACK_TYPE end |