blob: b72d4e655796e403aca6183feeee940d020811d2 [file] [log] [blame]
sangho538108b2015-04-08 14:29:20 -07001/*
2 * Copyright 2015 Open Networking Laboratory
3 *
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 */
28 public int port();
29
30 /**
31 * Returns the number of packets received.
32 *
33 * @return the number of packets received
34 */
35 public long packetsReceived();
36
37 /**
38 * Returns the number of packets sent.
39 *
40 * @return the number of packets sent
41 */
42 public long packetsSent();
43
44 /**
45 * Returns the bytes received.
46 *
47 * @return the bytes received
48 */
49 public long bytesReceived();
50
51 /**
52 * Returns the bytes sent.
53 *
54 * @return the bytes sent
55 */
56 public long bytesSent();
57
58 /**
59 * Returns the number of packets dropped by RX.
60 *
61 * @return the number of packets dropped by RX
62 */
63 public long packetsRxDropped();
64
65 /**
66 * Returns the number of packets dropped by TX.
67 *
68 * @return the number of packets dropped by TX
69 */
70 public long packetsTxDropped();
71
72 /**
73 * Returns the number of transmit errors.
74 *
75 * @return the number of transmit errors
76 */
77 public long packetsRxErrors();
78
79 /**
80 * Returns the number of receive errors.
81 *
82 * @return the number of receive error
83 */
84 public long packetsTxErrors();
85
86 /**
87 * Returns the time port has been alive in seconds.
88 *
89 * @return the time port has been alive in seconds
90 */
91 public long durationSec();
92
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 */
98 public long durationNano();
99
100}