This is an automated email from the ASF dual-hosted git repository.
sodonnell pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git
The following commit(s) were added to refs/heads/master by this push:
new 4fe7824f9f HDDS-6154. Update NodeManagerInsight with the correct node
metrics (#5394)
4fe7824f9f is described below
commit 4fe7824f9fe3923e4a82cd69321b2ffd2196b9ed
Author: VarshaRavi <[email protected]>
AuthorDate: Wed Oct 25 21:08:23 2023 +0530
HDDS-6154. Update NodeManagerInsight with the correct node metrics (#5394)
---
.../hadoop/ozone/insight/scm/NodeManagerInsight.java | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git
a/hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/scm/NodeManagerInsight.java
b/hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/scm/NodeManagerInsight.java
index a6ba5e3209..f76f87e574 100644
---
a/hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/scm/NodeManagerInsight.java
+++
b/hadoop-ozone/insight/src/main/java/org/apache/hadoop/ozone/insight/scm/NodeManagerInsight.java
@@ -27,6 +27,8 @@ import org.apache.hadoop.ozone.insight.Component.Type;
import org.apache.hadoop.ozone.insight.LoggerSource;
import org.apache.hadoop.ozone.insight.MetricDisplay;
import org.apache.hadoop.ozone.insight.MetricGroupDisplay;
+import org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeOperationalState;
+import org.apache.hadoop.hdds.protocol.proto.HddsProtos.NodeState;
/**
* Insight definition to check node manager / node report events.
@@ -50,11 +52,15 @@ public class NodeManagerInsight extends BaseInsightPoint {
MetricGroupDisplay nodes =
new MetricGroupDisplay(Type.SCM, "Node counters");
- nodes.addMetrics(
- new MetricDisplay("Healthy Nodes", "scm_node_manager_healthy_nodes"));
- nodes.addMetrics(
- new MetricDisplay("Dead Nodes", "scm_node_manager_dead_nodes"));
-
+ for (NodeOperationalState opState : NodeOperationalState.values()) {
+ for (NodeState healthState : NodeState.values()) {
+ String metricId = String.format("scm_node_manager_%s_%s_nodes",
+ opState, healthState).toLowerCase();
+ String metricDescription = String.format("%s %s Nodes",
+ opState, healthState);
+ nodes.addMetrics(new MetricDisplay(metricDescription, metricId));
+ }
+ }
display.add(nodes);
MetricGroupDisplay hb =
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]