alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 1 | package org.onlab.onos.net.statistic; |
| 2 | |
| 3 | import org.onlab.onos.net.ConnectPoint; |
| 4 | import org.onlab.onos.net.Link; |
| 5 | import org.onlab.onos.net.Path; |
| 6 | import org.onlab.onos.net.flow.FlowRule; |
| 7 | |
| 8 | /** |
| 9 | * Service for obtaining statistic information about link in the system. |
| 10 | * Statistics are obtained from the FlowRuleService in order to minimize the |
| 11 | * amount of hammering occuring at the dataplane. |
| 12 | */ |
| 13 | public interface StatisticService { |
| 14 | |
| 15 | /** |
| 16 | * Obtain the load for a the ingress to the given link. |
| 17 | * @param link the link to query. |
| 18 | * @return a {@link org.onlab.onos.net.statistic.Load Load} |
| 19 | */ |
| 20 | Load load(Link link); |
| 21 | |
| 22 | /** |
| 23 | * Obtain the load for the given port. |
| 24 | * @param connectPoint the port to query |
| 25 | * @return a {@link org.onlab.onos.net.statistic.Load} |
| 26 | */ |
| 27 | Load load(ConnectPoint connectPoint); |
| 28 | |
| 29 | /** |
| 30 | * Find the most loaded link along a path. |
| 31 | * @param path the path to search in |
| 32 | * @return the most loaded {@link org.onlab.onos.net.Link}. |
| 33 | */ |
| 34 | Link max(Path path); |
| 35 | |
| 36 | /** |
| 37 | * Find the least loaded link along a path. |
| 38 | * @param path the path to search in |
| 39 | * @return the least loaded {@link org.onlab.onos.net.Link}. |
| 40 | */ |
| 41 | Link min(Path path); |
| 42 | |
| 43 | /** |
alshabib | c1c056b | 2014-10-21 21:42:51 -0700 | [diff] [blame] | 44 | * Returns the highest hitter (a flow rule) for a given port, ie. the |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 45 | * flow rule which is generating the most load. |
| 46 | * @param connectPoint the port |
| 47 | * @return the flow rule |
| 48 | */ |
| 49 | FlowRule highestHitter(ConnectPoint connectPoint); |
| 50 | |
| 51 | } |