Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | package org.onosproject.cpman; |
| 17 | |
| 18 | import org.onosproject.cluster.NodeId; |
| 19 | import org.onosproject.net.DeviceId; |
| 20 | |
| 21 | import java.util.Optional; |
| 22 | import java.util.concurrent.TimeUnit; |
| 23 | |
| 24 | /** |
| 25 | * Control Plane Statistics Service Interface. |
| 26 | */ |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 27 | public interface ControlPlaneMonitorService { |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 28 | |
| 29 | /** |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 30 | * Adds a new control metric value with a certain update interval. |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 31 | * |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 32 | * @param controlMetric control plane metric (e.g., control message rate, cpu, memory, etc.) |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 33 | * @param updateInterval value update interval (time unit will be in minute) |
Jian Li | dfba739 | 2016-01-22 16:46:58 -0800 | [diff] [blame^] | 34 | * @param deviceId {@link org.onosproject.net.DeviceId} |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 35 | */ |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 36 | void updateMetric(ControlMetric controlMetric, int updateInterval, Optional<DeviceId> deviceId); |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 37 | |
| 38 | /** |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 39 | * Obtains the control plane load of a specific device. |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 40 | * |
| 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 Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 46 | ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId); |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 47 | |
| 48 | /** |
Jian Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 49 | * Obtains the control plane load of a specific device with a specific time duration. |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 50 | * |
| 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 Li | 6080432 | 2015-12-02 14:46:31 -0800 | [diff] [blame] | 58 | ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId, |
| 59 | int duration, TimeUnit unit); |
Jian Li | 0967cd7 | 2015-11-25 17:38:48 -0800 | [diff] [blame] | 60 | } |