Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 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 | */ |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 16 | package org.onlab.onos.net.statistic; |
| 17 | |
| 18 | import org.onlab.onos.net.ConnectPoint; |
| 19 | import org.onlab.onos.net.Link; |
| 20 | import org.onlab.onos.net.Path; |
| 21 | import org.onlab.onos.net.flow.FlowRule; |
| 22 | |
| 23 | /** |
| 24 | * Service for obtaining statistic information about link in the system. |
| 25 | * Statistics are obtained from the FlowRuleService in order to minimize the |
| 26 | * amount of hammering occuring at the dataplane. |
| 27 | */ |
| 28 | public interface StatisticService { |
| 29 | |
| 30 | /** |
| 31 | * Obtain the load for a the ingress to the given link. |
| 32 | * @param link the link to query. |
| 33 | * @return a {@link org.onlab.onos.net.statistic.Load Load} |
| 34 | */ |
| 35 | Load load(Link link); |
| 36 | |
| 37 | /** |
| 38 | * Obtain the load for the given port. |
| 39 | * @param connectPoint the port to query |
| 40 | * @return a {@link org.onlab.onos.net.statistic.Load} |
| 41 | */ |
| 42 | Load load(ConnectPoint connectPoint); |
| 43 | |
| 44 | /** |
| 45 | * Find the most loaded link along a path. |
| 46 | * @param path the path to search in |
| 47 | * @return the most loaded {@link org.onlab.onos.net.Link}. |
| 48 | */ |
| 49 | Link max(Path path); |
| 50 | |
| 51 | /** |
| 52 | * Find the least loaded link along a path. |
| 53 | * @param path the path to search in |
| 54 | * @return the least loaded {@link org.onlab.onos.net.Link}. |
| 55 | */ |
| 56 | Link min(Path path); |
| 57 | |
| 58 | /** |
alshabib | c1c056b | 2014-10-21 21:42:51 -0700 | [diff] [blame] | 59 | * Returns the highest hitter (a flow rule) for a given port, ie. the |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 60 | * flow rule which is generating the most load. |
| 61 | * @param connectPoint the port |
| 62 | * @return the flow rule |
| 63 | */ |
| 64 | FlowRule highestHitter(ConnectPoint connectPoint); |
| 65 | |
| 66 | } |