sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.net.device; |
| 17 | |
| 18 | /** |
| 19 | * Statistics of a port. |
| 20 | */ |
| 21 | public interface PortStatistics { |
| 22 | |
| 23 | /** |
| 24 | * Returns the port number. |
| 25 | * |
| 26 | * @return port number |
| 27 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 28 | int port(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 29 | |
| 30 | /** |
| 31 | * Returns the number of packets received. |
| 32 | * |
| 33 | * @return the number of packets received |
| 34 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 35 | long packetsReceived(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 36 | |
| 37 | /** |
| 38 | * Returns the number of packets sent. |
| 39 | * |
| 40 | * @return the number of packets sent |
| 41 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 42 | long packetsSent(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 43 | |
| 44 | /** |
| 45 | * Returns the bytes received. |
| 46 | * |
| 47 | * @return the bytes received |
| 48 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 49 | long bytesReceived(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 50 | |
| 51 | /** |
| 52 | * Returns the bytes sent. |
| 53 | * |
| 54 | * @return the bytes sent |
| 55 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 56 | long bytesSent(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 57 | |
| 58 | /** |
| 59 | * Returns the number of packets dropped by RX. |
| 60 | * |
| 61 | * @return the number of packets dropped by RX |
| 62 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 63 | long packetsRxDropped(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 64 | |
| 65 | /** |
| 66 | * Returns the number of packets dropped by TX. |
| 67 | * |
| 68 | * @return the number of packets dropped by TX |
| 69 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 70 | long packetsTxDropped(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 71 | |
| 72 | /** |
| 73 | * Returns the number of transmit errors. |
| 74 | * |
| 75 | * @return the number of transmit errors |
| 76 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 77 | long packetsRxErrors(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 78 | |
| 79 | /** |
| 80 | * Returns the number of receive errors. |
| 81 | * |
| 82 | * @return the number of receive error |
| 83 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 84 | long packetsTxErrors(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 85 | |
| 86 | /** |
| 87 | * Returns the time port has been alive in seconds. |
| 88 | * |
| 89 | * @return the time port has been alive in seconds |
| 90 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 91 | long durationSec(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 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 | */ |
Sho SHIMIZU | 3310a34 | 2015-05-13 12:14:05 -0700 | [diff] [blame] | 98 | long durationNano(); |
sangho | 538108b | 2015-04-08 14:29:20 -0700 | [diff] [blame] | 99 | |
| 100 | } |