blob: e0ab383c5c819159be85dc0de10c8e6b2f3ba60f [file] [log] [blame]
sangho538108b2015-04-08 14:29:20 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2015-present Open Networking Laboratory
sangho538108b2015-04-08 14:29:20 -07003 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.net.device;
17
18/**
19 * Statistics of a port.
20 */
21public interface PortStatistics {
22
23 /**
24 * Returns the port number.
25 *
26 * @return port number
27 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070028 int port();
sangho538108b2015-04-08 14:29:20 -070029
30 /**
31 * Returns the number of packets received.
32 *
33 * @return the number of packets received
34 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070035 long packetsReceived();
sangho538108b2015-04-08 14:29:20 -070036
37 /**
38 * Returns the number of packets sent.
39 *
40 * @return the number of packets sent
41 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070042 long packetsSent();
sangho538108b2015-04-08 14:29:20 -070043
44 /**
45 * Returns the bytes received.
46 *
47 * @return the bytes received
48 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070049 long bytesReceived();
sangho538108b2015-04-08 14:29:20 -070050
51 /**
52 * Returns the bytes sent.
53 *
54 * @return the bytes sent
55 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070056 long bytesSent();
sangho538108b2015-04-08 14:29:20 -070057
58 /**
59 * Returns the number of packets dropped by RX.
60 *
61 * @return the number of packets dropped by RX
62 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070063 long packetsRxDropped();
sangho538108b2015-04-08 14:29:20 -070064
65 /**
66 * Returns the number of packets dropped by TX.
67 *
68 * @return the number of packets dropped by TX
69 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070070 long packetsTxDropped();
sangho538108b2015-04-08 14:29:20 -070071
72 /**
73 * Returns the number of transmit errors.
74 *
75 * @return the number of transmit errors
76 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070077 long packetsRxErrors();
sangho538108b2015-04-08 14:29:20 -070078
79 /**
80 * Returns the number of receive errors.
81 *
82 * @return the number of receive error
83 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070084 long packetsTxErrors();
sangho538108b2015-04-08 14:29:20 -070085
86 /**
87 * Returns the time port has been alive in seconds.
88 *
89 * @return the time port has been alive in seconds
90 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070091 long durationSec();
sangho538108b2015-04-08 14:29:20 -070092
93 /**
94 * Returns the time port has been alive in nano seconds.
95 *
96 * @return the time port has been alive in nano seconds
97 */
Sho SHIMIZU3310a342015-05-13 12:14:05 -070098 long durationNano();
sangho538108b2015-04-08 14:29:20 -070099
100}