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. |
Sho SHIMIZU | cf6090b | 2014-11-13 17:34:46 -0800 | [diff] [blame^] | 32 | * |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 33 | * @param link the link to query. |
| 34 | * @return a {@link org.onlab.onos.net.statistic.Load Load} |
| 35 | */ |
| 36 | Load load(Link link); |
| 37 | |
| 38 | /** |
| 39 | * Obtain the load for the given port. |
Sho SHIMIZU | cf6090b | 2014-11-13 17:34:46 -0800 | [diff] [blame^] | 40 | * |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 41 | * @param connectPoint the port to query |
| 42 | * @return a {@link org.onlab.onos.net.statistic.Load} |
| 43 | */ |
| 44 | Load load(ConnectPoint connectPoint); |
| 45 | |
| 46 | /** |
| 47 | * Find the most loaded link along a path. |
Sho SHIMIZU | cf6090b | 2014-11-13 17:34:46 -0800 | [diff] [blame^] | 48 | * |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 49 | * @param path the path to search in |
| 50 | * @return the most loaded {@link org.onlab.onos.net.Link}. |
| 51 | */ |
| 52 | Link max(Path path); |
| 53 | |
| 54 | /** |
| 55 | * Find the least loaded link along a path. |
Sho SHIMIZU | cf6090b | 2014-11-13 17:34:46 -0800 | [diff] [blame^] | 56 | * |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 57 | * @param path the path to search in |
| 58 | * @return the least loaded {@link org.onlab.onos.net.Link}. |
| 59 | */ |
| 60 | Link min(Path path); |
| 61 | |
| 62 | /** |
alshabib | c1c056b | 2014-10-21 21:42:51 -0700 | [diff] [blame] | 63 | * Returns the highest hitter (a flow rule) for a given port, ie. the |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 64 | * flow rule which is generating the most load. |
Sho SHIMIZU | cf6090b | 2014-11-13 17:34:46 -0800 | [diff] [blame^] | 65 | * |
alshabib | a43aa25 | 2014-10-21 21:36:41 -0700 | [diff] [blame] | 66 | * @param connectPoint the port |
| 67 | * @return the flow rule |
| 68 | */ |
| 69 | FlowRule highestHitter(ConnectPoint connectPoint); |
| 70 | |
| 71 | } |