blob: cc974744f36e5982619492c447863e533e478b75 [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.
Sho SHIMIZUcf6090b2014-11-13 17:34:46 -080032 *
alshabiba43aa252014-10-21 21:36:41 -070033 * @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 SHIMIZUcf6090b2014-11-13 17:34:46 -080040 *
alshabiba43aa252014-10-21 21:36:41 -070041 * @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 SHIMIZUcf6090b2014-11-13 17:34:46 -080048 *
alshabiba43aa252014-10-21 21:36:41 -070049 * @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 SHIMIZUcf6090b2014-11-13 17:34:46 -080056 *
alshabiba43aa252014-10-21 21:36:41 -070057 * @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 /**
alshabibc1c056b2014-10-21 21:42:51 -070063 * Returns the highest hitter (a flow rule) for a given port, ie. the
alshabiba43aa252014-10-21 21:36:41 -070064 * flow rule which is generating the most load.
Sho SHIMIZUcf6090b2014-11-13 17:34:46 -080065 *
alshabiba43aa252014-10-21 21:36:41 -070066 * @param connectPoint the port
67 * @return the flow rule
68 */
69 FlowRule highestHitter(ConnectPoint connectPoint);
70
71}