blob: d4e6bc5f44be8063b3eec0f4b3267fc1407227bd [file] [log] [blame]
Jian Li0967cd72015-11-25 17:38:48 -08001/*
Jian Lie044d1a2016-01-25 09:01:20 -08002 * Copyright 2015-2016 Open Networking Laboratory
Jian Li0967cd72015-11-25 17:38:48 -08003 *
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 Lic132c112016-01-28 20:27:34 -080036 void updateMetric(ControlMetric controlMetric, Integer updateInterval, Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080037
38 /**
Jian Lie044d1a2016-01-25 09:01:20 -080039 * Adds a new control metric value with a certain update interval.
40 *
41 * @param controlMetric control plane metric (e.g., disk and network metrics)
42 * @param updateInterval value update interval (time unit will be in minute)
43 * @param resourceName resource name
44 */
Jian Lic132c112016-01-28 20:27:34 -080045 void updateMetric(ControlMetric controlMetric, Integer updateInterval, String resourceName);
Jian Lie044d1a2016-01-25 09:01:20 -080046
47 /**
Jian Li60804322015-12-02 14:46:31 -080048 * Obtains the control plane load of a specific device.
Jian Li0967cd72015-11-25 17:38:48 -080049 *
50 * @param nodeId node id {@link org.onosproject.cluster.NodeId}
51 * @param type control metric type
52 * @param deviceId device id {@link org.onosproject.net.DeviceId}
53 * @return control plane load
54 */
Jian Li60804322015-12-02 14:46:31 -080055 ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080056
57 /**
Jian Li60804322015-12-02 14:46:31 -080058 * Obtains the control plane load of a specific device with a specific time duration.
Jian Li0967cd72015-11-25 17:38:48 -080059 *
60 * @param nodeId node id {@link org.onosproject.cluster.NodeId}
61 * @param type control metric type
62 * @param duration time duration
63 * @param unit time unit
64 * @param deviceId device id {@link org.onosproject.net.Device}
65 * @return control plane load
66 */
Jian Li60804322015-12-02 14:46:31 -080067 ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId,
68 int duration, TimeUnit unit);
Jian Li0967cd72015-11-25 17:38:48 -080069}