errose28 commented on code in PR #10034:
URL: https://github.com/apache/ozone/pull/10034#discussion_r3406727873


##########
hadoop-hdds/server-scm/src/main/java/org/apache/hadoop/hdds/scm/container/placement/metrics/SCMMetrics.java:
##########
@@ -155,6 +171,22 @@ public void decrContainerStat(ContainerStat deltaStat) {
     this.containerReportWriteCount.incr(-1 * deltaStat.getWriteCount().get());
   }
 
+  public void addRatisEvent(String event) {
+    synchronized (ratisEvents) {
+      if (ratisEvents.size() >= maxRatisEvents) {
+        ratisEvents.removeFirst();
+      }
+      ratisEvents.add(Time.formatTime(Time.now()) + "|" + event);
+    }
+  }
+
+  @Metric("Ratis state machine events")
+  public String getRatisEvents() {
+    synchronized (ratisEvents) {
+      return String.join("\n", ratisEvents);

Review Comment:
   Actually the streamed Ratis events can have arbitrary content, it's not just 
the hardcoded separator. It looks like this was never meant to be surfaced to 
Prometheus or JMX and I don't think we should be tracking Ratis events as 
metrics at all. We can keep the Linklist and query it from memory elsewhere. 
Filed HDDS-15552.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to