blob: f0c4e635aa53d0d061751fadfd9b20c7eb830970 [file] [log] [blame]
Jian Li0967cd72015-11-25 17:38:48 -08001/*
2 * Copyright 2015 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 */
16package org.onosproject.cpman;
17
18import org.onosproject.net.statistic.Load;
19
20import java.util.concurrent.TimeUnit;
21
22/**
23 * Data repository for control plane load information.
24 */
Jian Li60804322015-12-02 14:46:31 -080025public interface ControlLoad extends Load {
Jian Li0967cd72015-11-25 17:38:48 -080026
27 /**
Jian Li60804322015-12-02 14:46:31 -080028 * Obtains the average of the specified time duration.
Jian Li0967cd72015-11-25 17:38:48 -080029 *
30 * @param duration time duration
31 * @param unit time unit
32 * @return average control plane metric value
33 */
34 long average(int duration, TimeUnit unit);
35
36 /**
Jian Li60804322015-12-02 14:46:31 -080037 * Obtains the average of all time duration.
Jian Li0967cd72015-11-25 17:38:48 -080038 *
39 * @return average control plane metric value
40 */
41 long average();
Jian Liec343ff2016-02-02 17:11:13 -080042
43 /**
44 * Obtains the most recent metric values of the specified time duration.
45 *
46 * @param duration time duration
47 * @param unit time unit
48 * @return a collection of the most recent metric values
49 */
50 long[] recent(int duration, TimeUnit unit);
51
52 /**
53 * Obtains all metrics.
54 *
55 * @return a collection of the all metric values
56 */
57 long[] all();
Jian Li0967cd72015-11-25 17:38:48 -080058}