Package org.onosproject.net.device
Class DefaultPortStatistics
- java.lang.Object
-
- org.onosproject.net.AbstractAnnotated
-
- org.onosproject.net.device.DefaultPortStatistics
-
- All Implemented Interfaces:
Annotated
,PortStatistics
public final class DefaultPortStatistics extends AbstractAnnotated implements PortStatistics
Default implementation of immutable port statistics.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DefaultPortStatistics.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultPortStatistics.Builder
builder()
Creates a builder for DefaultPortStatistics object.long
bytesReceived()
Returns the bytes received.long
bytesSent()
Returns the bytes sent.long
durationNano()
Returns the time port has been alive in nano seconds.long
durationSec()
Returns the time port has been alive in seconds.boolean
isZero()
Returns true if all the port stats are zero, excluding TxErrors and RxErrors.long
packetsReceived()
Returns the number of packets received.long
packetsRxDropped()
Returns the number of packets dropped by RX.long
packetsRxErrors()
Returns the number of transmit errors.long
packetsSent()
Returns the number of packets sent.long
packetsTxDropped()
Returns the number of packets dropped by TX.long
packetsTxErrors()
Returns the number of receive errors.PortNumber
portNumber()
Returns the port number.java.lang.String
toString()
-
Methods inherited from class org.onosproject.net.AbstractAnnotated
annotations
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.onosproject.net.device.PortStatistics
annotations
-
-
-
-
Method Detail
-
builder
public static DefaultPortStatistics.Builder builder()
Creates a builder for DefaultPortStatistics object.- Returns:
- builder object for DefaultPortStatistics object
-
portNumber
public PortNumber portNumber()
Description copied from interface:PortStatistics
Returns the port number.- Specified by:
portNumber
in interfacePortStatistics
- Returns:
- port number
-
packetsReceived
public long packetsReceived()
Description copied from interface:PortStatistics
Returns the number of packets received.- Specified by:
packetsReceived
in interfacePortStatistics
- Returns:
- the number of packets received
-
packetsSent
public long packetsSent()
Description copied from interface:PortStatistics
Returns the number of packets sent.- Specified by:
packetsSent
in interfacePortStatistics
- Returns:
- the number of packets sent
-
bytesReceived
public long bytesReceived()
Description copied from interface:PortStatistics
Returns the bytes received.- Specified by:
bytesReceived
in interfacePortStatistics
- Returns:
- the bytes received
-
bytesSent
public long bytesSent()
Description copied from interface:PortStatistics
Returns the bytes sent.- Specified by:
bytesSent
in interfacePortStatistics
- Returns:
- the bytes sent
-
packetsRxDropped
public long packetsRxDropped()
Description copied from interface:PortStatistics
Returns the number of packets dropped by RX.- Specified by:
packetsRxDropped
in interfacePortStatistics
- Returns:
- the number of packets dropped by RX
-
packetsTxDropped
public long packetsTxDropped()
Description copied from interface:PortStatistics
Returns the number of packets dropped by TX.- Specified by:
packetsTxDropped
in interfacePortStatistics
- Returns:
- the number of packets dropped by TX
-
packetsRxErrors
public long packetsRxErrors()
Description copied from interface:PortStatistics
Returns the number of transmit errors.- Specified by:
packetsRxErrors
in interfacePortStatistics
- Returns:
- the number of transmit errors
-
packetsTxErrors
public long packetsTxErrors()
Description copied from interface:PortStatistics
Returns the number of receive errors.- Specified by:
packetsTxErrors
in interfacePortStatistics
- Returns:
- the number of receive error
-
durationSec
public long durationSec()
Description copied from interface:PortStatistics
Returns the time port has been alive in seconds.- Specified by:
durationSec
in interfacePortStatistics
- Returns:
- the time port has been alive in seconds
-
durationNano
public long durationNano()
Description copied from interface:PortStatistics
Returns the time port has been alive in nano seconds.- Specified by:
durationNano
in interfacePortStatistics
- Returns:
- the time port has been alive in nano seconds
-
isZero
public boolean isZero()
Description copied from interface:PortStatistics
Returns true if all the port stats are zero, excluding TxErrors and RxErrors.- Specified by:
isZero
in interfacePortStatistics
- Returns:
- boolean true if all port stats are zero
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-