blob: 051d1c7070890ba9b02188c90ba409042bb72531 [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;
Jian Li85060ac2016-02-04 09:58:56 -080022import java.util.Set;
23
24import static org.onosproject.cpman.ControlResource.*;
Jian Li0967cd72015-11-25 17:38:48 -080025
26/**
27 * Control Plane Statistics Service Interface.
28 */
Jian Li60804322015-12-02 14:46:31 -080029public interface ControlPlaneMonitorService {
Jian Li0967cd72015-11-25 17:38:48 -080030
31 /**
Jian Li60804322015-12-02 14:46:31 -080032 * Adds a new control metric value with a certain update interval.
Jian Li0967cd72015-11-25 17:38:48 -080033 *
Jian Lic5cb4a12016-02-03 23:24:42 -080034 * @param controlMetric control plane metric (e.g., control
35 * message rate, cpu, memory, etc.)
36 * @param updateIntervalInMinutes value update interval (in minute)
37 * @param deviceId device identifier
Jian Li0967cd72015-11-25 17:38:48 -080038 */
Jian Lic5cb4a12016-02-03 23:24:42 -080039 void updateMetric(ControlMetric controlMetric, int updateIntervalInMinutes,
40 Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080041
42 /**
Jian Lie044d1a2016-01-25 09:01:20 -080043 * Adds a new control metric value with a certain update interval.
44 *
Jian Lic5cb4a12016-02-03 23:24:42 -080045 * @param controlMetric control plane metric (e.g., disk and
46 * network metrics)
47 * @param updateIntervalInMinutes value update interval (in minute)
48 * @param resourceName resource name
Jian Lie044d1a2016-01-25 09:01:20 -080049 */
Jian Lic5cb4a12016-02-03 23:24:42 -080050 void updateMetric(ControlMetric controlMetric, int updateIntervalInMinutes,
51 String resourceName);
Jian Lie044d1a2016-01-25 09:01:20 -080052
53 /**
Jian Li60804322015-12-02 14:46:31 -080054 * Obtains the control plane load of a specific device.
Jian Li7d180c52016-02-01 21:53:08 -080055 * The metrics range from control messages and system metrics
56 * (e.g., CPU and memory info)
Jian Li0967cd72015-11-25 17:38:48 -080057 *
Jian Lic5cb4a12016-02-03 23:24:42 -080058 * @param nodeId node identifier
59 * @param type control metric type
60 * @param deviceId device identifier
Jian Li0967cd72015-11-25 17:38:48 -080061 * @return control plane load
62 */
Jian Lic5cb4a12016-02-03 23:24:42 -080063 ControlLoad getLoad(NodeId nodeId, ControlMetricType type,
64 Optional<DeviceId> deviceId);
Jian Li0967cd72015-11-25 17:38:48 -080065
66 /**
Jian Li7d180c52016-02-01 21:53:08 -080067 * Obtains the control plane load of a specific device.
Jian Lic5cb4a12016-02-03 23:24:42 -080068 * The metrics range from I/O device metrics
69 * (e.g., disk and network interface)
Jian Li0967cd72015-11-25 17:38:48 -080070 *
Jian Lic5cb4a12016-02-03 23:24:42 -080071 * @param nodeId node identifier
72 * @param type control metric type
73 * @param resourceName resource name
Jian Li0967cd72015-11-25 17:38:48 -080074 * @return control plane load
75 */
Jian Li7d180c52016-02-01 21:53:08 -080076 ControlLoad getLoad(NodeId nodeId, ControlMetricType type, String resourceName);
Jian Li85060ac2016-02-04 09:58:56 -080077
78 /**
79 * Obtains a list of names of available resources.
80 *
Jian Li72b9b122016-02-11 15:58:51 -080081 * @param resourceType resource type
Jian Li85060ac2016-02-04 09:58:56 -080082 * @return a collection of names of available resources
83 */
84 Set<String> availableResources(Type resourceType);
Jian Li0967cd72015-11-25 17:38:48 -080085}