blob: 3c9f3e57f08bf52d3181412c66d159354a71b7c7 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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 */
alshabiba43aa252014-10-21 21:36:41 -070016package org.onlab.onos.net.statistic;
17
18import org.onlab.onos.net.ConnectPoint;
19import org.onlab.onos.net.Link;
20import org.onlab.onos.net.Path;
21import 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 */
28public 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 /**
alshabibc1c056b2014-10-21 21:42:51 -070059 * Returns the highest hitter (a flow rule) for a given port, ie. the
alshabiba43aa252014-10-21 21:36:41 -070060 * 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}