You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ozone.apache.org by GitBox <gi...@apache.org> on 2020/04/03 17:11:36 UTC

[GitHub] [hadoop-ozone] swagle commented on a change in pull request #761: HDDS-3336. Metrics for Recon OzoneManager DB sync.

swagle commented on a change in pull request #761: HDDS-3336. Metrics for Recon OzoneManager DB sync.
URL: https://github.com/apache/hadoop-ozone/pull/761#discussion_r403157839
 
 

 ##########
 File path: hadoop-ozone/recon/src/main/java/org/apache/hadoop/ozone/recon/metrics/OzoneManagerSyncMetrics.java
 ##########
 @@ -0,0 +1,151 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.hadoop.ozone.recon.metrics;
+
+import org.apache.hadoop.hdds.annotation.InterfaceAudience;
+import org.apache.hadoop.metrics2.MetricsSystem;
+import org.apache.hadoop.metrics2.annotation.Metric;
+import org.apache.hadoop.metrics2.annotation.Metrics;
+import org.apache.hadoop.metrics2.lib.DefaultMetricsSystem;
+import org.apache.hadoop.metrics2.lib.MutableCounterLong;
+import org.apache.hadoop.metrics2.lib.MutableGaugeFloat;
+import org.apache.hadoop.metrics2.lib.MutableRate;
+import org.apache.hadoop.ozone.OzoneConsts;
+
+/**
+ * Class for tracking metrics related to Ozone manager sync operations.
+ */
+@InterfaceAudience.Private
+@Metrics(about = "Recon OzoneManagerSync Metrics", context = OzoneConsts.OZONE)
+public final class OzoneManagerSyncMetrics {
+
+  private static final String SOURCE_NAME =
+      OzoneManagerSyncMetrics.class.getSimpleName();
+
+  private OzoneManagerSyncMetrics() {
+  }
+
+  public static OzoneManagerSyncMetrics create() {
+    MetricsSystem ms = DefaultMetricsSystem.instance();
+    return ms.register(SOURCE_NAME,
+        "Recon Ozone Manager Sync Metrics",
+        new OzoneManagerSyncMetrics());
+  }
+
+  public void unRegister() {
+    MetricsSystem ms = DefaultMetricsSystem.instance();
+    ms.unregisterSource(SOURCE_NAME);
+  }
+
+  @Metric(about = "Number of OM snapshot requests made by Recon.")
+  private MutableCounterLong numSnapshotRequests;
+
+  @Metric(about = "Number of OM snapshot requests that failed.")
+  private MutableCounterLong numSnapshotRequestsFailed;
+
+  @Metric(about = "OM snapshot request latency")
+  private MutableRate snapshotRequestLatency;
+
+  @Metric(about = "Number of OM delta requests made by Recon.")
+  private MutableCounterLong numDeltaRequests;
+
+  @Metric(about = "Number of OM delta requests made by Recon that had " +
+      "at least 1 update in the response.")
+  private MutableCounterLong numNonZeroDeltaRequests;
 
 Review comment:
   Why the need to track nonZero? Zero and total should be enough, no?

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: ozone-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: ozone-issues-help@hadoop.apache.org