blob: db00278c7fbe10d74b487646c82b64c0d0efd8b0 [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)
34 */
Jian Li60804322015-12-02 14:46:31 -080035 void updateMetric(ControlMetric controlMetric, int updateInterval, Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080036
37 /**
Jian Li60804322015-12-02 14:46:31 -080038 * Obtains the control plane load of a specific device.
Jian Li0967cd72015-11-25 17:38:48 -080039 *
40 * @param nodeId node id {@link org.onosproject.cluster.NodeId}
41 * @param type control metric type
42 * @param deviceId device id {@link org.onosproject.net.DeviceId}
43 * @return control plane load
44 */
Jian Li60804322015-12-02 14:46:31 -080045 ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080046
47 /**
Jian Li60804322015-12-02 14:46:31 -080048 * Obtains the control plane load of a specific device with a specific time duration.
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 duration time duration
53 * @param unit time unit
54 * @param deviceId device id {@link org.onosproject.net.Device}
55 * @return control plane load
56 */
Jian Li60804322015-12-02 14:46:31 -080057 ControlLoad getLoad(NodeId nodeId, ControlMetricType type, Optional<DeviceId> deviceId,
58 int duration, TimeUnit unit);
Jian Li0967cd72015-11-25 17:38:48 -080059}