kdarapu | 97843dc | 2018-05-10 12:46:32 +0530 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2017-present Open Networking Foundation |
| 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 | |
| 17 | package org.onosproject.nodemetrics; |
| 18 | |
| 19 | import org.onosproject.cluster.NodeId; |
| 20 | |
| 21 | import java.util.Map; |
| 22 | |
| 23 | /** |
| 24 | * Nodemetrics Application is to fetch Controller Resource metrics. |
| 25 | * The Control Resource metrics includes Memory, |
| 26 | * CPU usage and Disk usage of All the cluster nodes. |
| 27 | */ |
| 28 | public interface NodeMetricsService { |
| 29 | /** |
| 30 | * Returns may memory information of all Cluster nodes. |
| 31 | * @return map |
| 32 | */ |
nitinanand | 920fcb4 | 2018-05-18 17:30:36 +0530 | [diff] [blame] | 33 | Map<NodeId, NodeMemoryUsage> memory(); |
kdarapu | 97843dc | 2018-05-10 12:46:32 +0530 | [diff] [blame] | 34 | |
| 35 | /** |
| 36 | * Returns may disk information of all Cluster nodes. |
| 37 | * @return map |
| 38 | */ |
| 39 | Map<NodeId, NodeDiskUsage> disk(); |
| 40 | |
| 41 | /** |
| 42 | * Returns may CPU information of all Cluster nodes. |
| 43 | * @return map object, NodeId as key and NodeCpu information as value. |
| 44 | */ |
nitinanand | 920fcb4 | 2018-05-18 17:30:36 +0530 | [diff] [blame] | 45 | Map<NodeId, NodeCpuUsage> cpu(); |
kdarapu | 97843dc | 2018-05-10 12:46:32 +0530 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * Get the memory information of Specific Cluster node. |
| 49 | * @param nodeid to get Memory information of that respective cluster node. |
nitinanand | 920fcb4 | 2018-05-18 17:30:36 +0530 | [diff] [blame] | 50 | * @return NodememoryUsage object. |
kdarapu | 97843dc | 2018-05-10 12:46:32 +0530 | [diff] [blame] | 51 | */ |
nitinanand | 920fcb4 | 2018-05-18 17:30:36 +0530 | [diff] [blame] | 52 | NodeMemoryUsage memory(NodeId nodeid); |
kdarapu | 97843dc | 2018-05-10 12:46:32 +0530 | [diff] [blame] | 53 | |
| 54 | /** |
| 55 | * Get the disk information of Specific Cluster node. |
| 56 | * @param nodeid to get disk information of that respective cluster node. |
| 57 | * @return NodeDiskUsage object. |
| 58 | */ |
| 59 | NodeDiskUsage disk(NodeId nodeid); |
| 60 | |
| 61 | /** |
| 62 | * Get the CPU information of Specific Cluster node. |
| 63 | * @param nodeid to get CPU information of that respective cluster node. |
nitinanand | 920fcb4 | 2018-05-18 17:30:36 +0530 | [diff] [blame] | 64 | * @return NodeCpuUsage object. |
kdarapu | 97843dc | 2018-05-10 12:46:32 +0530 | [diff] [blame] | 65 | */ |
nitinanand | 920fcb4 | 2018-05-18 17:30:36 +0530 | [diff] [blame] | 66 | NodeCpuUsage cpu(NodeId nodeid); |
kdarapu | 97843dc | 2018-05-10 12:46:32 +0530 | [diff] [blame] | 67 | } |