blob: 24f771786a071e6a81466e872737e26d9766d292 [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.cluster.NodeId;
19import org.onosproject.net.DeviceId;
20
21import java.util.Optional;
22import java.util.concurrent.TimeUnit;
23
24/**
25 * Control Plane Statistics Service Interface.
26 */
Jian Li60804322015-12-02 14:46:31 -080027public interface ControlPlaneMonitorService {
Jian Li0967cd72015-11-25 17:38:48 -080028
29 /**
Jian Li60804322015-12-02 14:46:31 -080030 * Adds a new control metric value with a certain update interval.
Jian Li0967cd72015-11-25 17:38:48 -080031 *
Jian Li60804322015-12-02 14:46:31 -080032 * @param controlMetric control plane metric (e.g., control message rate, cpu, memory, etc.)
Jian Li0967cd72015-11-25 17:38:48 -080033 * @param updateInterval value update interval (time unit will be in minute)
Jian Lidfba7392016-01-22 16:46:58 -080034 * @param deviceId {@link org.onosproject.net.DeviceId}
Jian Li0967cd72015-11-25 17:38:48 -080035 */
Jian Li60804322015-12-02 14:46:31 -080036 void updateMetric(ControlMetric controlMetric, int updateInterval, Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080037
38 /**
Jian Li60804322015-12-02 14:46:31 -080039 * Obtains the control plane load of a specific device.
Jian Li0967cd72015-11-25 17:38:48 -080040 *
41 * @param nodeId node id {@link org.onosproject.cluster.NodeId}
42 * @param type control metric type
43 * @param deviceId device id {@link org.onosproject.net.DeviceId}
44 * @return control plane load
45 */
Jian Li60804322015-12-02 14:46:31 -080046 ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080047
48 /**
Jian Li60804322015-12-02 14:46:31 -080049 * Obtains the control plane load of a specific device with a specific time duration.
Jian Li0967cd72015-11-25 17:38:48 -080050 *
51 * @param nodeId node id {@link org.onosproject.cluster.NodeId}
52 * @param type control metric type
53 * @param duration time duration
54 * @param unit time unit
55 * @param deviceId device id {@link org.onosproject.net.Device}
56 * @return control plane load
57 */
Jian Li60804322015-12-02 14:46:31 -080058 ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId,
59 int duration, TimeUnit unit);
Jian Li0967cd72015-11-25 17:38:48 -080060}