blob: 4ad098576378754b45d0e51852439458ec7beed9 [file] [log] [blame]
kdarapu97843dc2018-05-10 12:46:32 +05301/*
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
17package org.onosproject.nodemetrics;
18
19import org.onosproject.cluster.NodeId;
20
21import 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 */
28public interface NodeMetricsService {
29 /**
30 * Returns may memory information of all Cluster nodes.
31 * @return map
32 */
nitinanand920fcb42018-05-18 17:30:36 +053033 Map<NodeId, NodeMemoryUsage> memory();
kdarapu97843dc2018-05-10 12:46:32 +053034
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 */
nitinanand920fcb42018-05-18 17:30:36 +053045 Map<NodeId, NodeCpuUsage> cpu();
kdarapu97843dc2018-05-10 12:46:32 +053046
47 /**
48 * Get the memory information of Specific Cluster node.
49 * @param nodeid to get Memory information of that respective cluster node.
nitinanand920fcb42018-05-18 17:30:36 +053050 * @return NodememoryUsage object.
kdarapu97843dc2018-05-10 12:46:32 +053051 */
nitinanand920fcb42018-05-18 17:30:36 +053052 NodeMemoryUsage memory(NodeId nodeid);
kdarapu97843dc2018-05-10 12:46:32 +053053
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.
nitinanand920fcb42018-05-18 17:30:36 +053064 * @return NodeCpuUsage object.
kdarapu97843dc2018-05-10 12:46:32 +053065 */
nitinanand920fcb42018-05-18 17:30:36 +053066 NodeCpuUsage cpu(NodeId nodeid);
kdarapu97843dc2018-05-10 12:46:32 +053067}