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 classDefaultPortStatistics.Builder
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static DefaultPortStatistics.Builderbuilder()Creates a builder for DefaultPortStatistics object.longbytesReceived()Returns the bytes received.longbytesSent()Returns the bytes sent.longdurationNano()Returns the time port has been alive in nano seconds.longdurationSec()Returns the time port has been alive in seconds.booleanisZero()Returns true if all the port stats are zero, excluding TxErrors and RxErrors.longpacketsReceived()Returns the number of packets received.longpacketsRxDropped()Returns the number of packets dropped by RX.longpacketsRxErrors()Returns the number of transmit errors.longpacketsSent()Returns the number of packets sent.longpacketsTxDropped()Returns the number of packets dropped by TX.longpacketsTxErrors()Returns the number of receive errors.PortNumberportNumber()Returns the port number.StringtoString()-
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:PortStatisticsReturns the port number.- Specified by:
portNumberin interfacePortStatistics- Returns:
- port number
-
packetsReceived
public long packetsReceived()
Description copied from interface:PortStatisticsReturns the number of packets received.- Specified by:
packetsReceivedin interfacePortStatistics- Returns:
- the number of packets received
-
packetsSent
public long packetsSent()
Description copied from interface:PortStatisticsReturns the number of packets sent.- Specified by:
packetsSentin interfacePortStatistics- Returns:
- the number of packets sent
-
bytesReceived
public long bytesReceived()
Description copied from interface:PortStatisticsReturns the bytes received.- Specified by:
bytesReceivedin interfacePortStatistics- Returns:
- the bytes received
-
bytesSent
public long bytesSent()
Description copied from interface:PortStatisticsReturns the bytes sent.- Specified by:
bytesSentin interfacePortStatistics- Returns:
- the bytes sent
-
packetsRxDropped
public long packetsRxDropped()
Description copied from interface:PortStatisticsReturns the number of packets dropped by RX.- Specified by:
packetsRxDroppedin interfacePortStatistics- Returns:
- the number of packets dropped by RX
-
packetsTxDropped
public long packetsTxDropped()
Description copied from interface:PortStatisticsReturns the number of packets dropped by TX.- Specified by:
packetsTxDroppedin interfacePortStatistics- Returns:
- the number of packets dropped by TX
-
packetsRxErrors
public long packetsRxErrors()
Description copied from interface:PortStatisticsReturns the number of transmit errors.- Specified by:
packetsRxErrorsin interfacePortStatistics- Returns:
- the number of transmit errors
-
packetsTxErrors
public long packetsTxErrors()
Description copied from interface:PortStatisticsReturns the number of receive errors.- Specified by:
packetsTxErrorsin interfacePortStatistics- Returns:
- the number of receive error
-
durationSec
public long durationSec()
Description copied from interface:PortStatisticsReturns the time port has been alive in seconds.- Specified by:
durationSecin interfacePortStatistics- Returns:
- the time port has been alive in seconds
-
durationNano
public long durationNano()
Description copied from interface:PortStatisticsReturns the time port has been alive in nano seconds.- Specified by:
durationNanoin interfacePortStatistics- Returns:
- the time port has been alive in nano seconds
-
isZero
public boolean isZero()
Description copied from interface:PortStatisticsReturns true if all the port stats are zero, excluding TxErrors and RxErrors.- Specified by:
isZeroin interfacePortStatistics- Returns:
- boolean true if all port stats are zero
-
-