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/12/07 16:15:15 UTC

[GitHub] [ozone] elek opened a new pull request #1669: HDDS-4460. Add metrics for closed container replication

elek opened a new pull request #1669:
URL: https://github.com/apache/ozone/pull/1669


   ## What changes were proposed in this pull request?
   
   
   Today it's hard to understand what's going on and what is the performance of the replication.
   
   ## What is the link to the Apache JIRA
   
   https://issues.apache.org/jira/browse/HDDS-4460
   
   ## How was this patch tested?
   
    1. Started docker compose cluster
    2. Generated keys
    3. Removed one datanode
    4. Restored one datanode
    5. Waited until data is replicated
    6. Checked the metrics


----------------------------------------------------------------
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



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


[GitHub] [ozone] elek commented on a change in pull request #1669: HDDS-4460. Add metrics for closed container replication

Posted by GitBox <gi...@apache.org>.
elek commented on a change in pull request #1669:
URL: https://github.com/apache/ozone/pull/1669#discussion_r552501437



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/MeasuredReplicator.java
##########
@@ -0,0 +1,109 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.container.replication;
+
+import java.time.Instant;
+
+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.MutableGaugeLong;
+import org.apache.hadoop.ozone.container.replication.ReplicationTask.Status;
+
+import com.google.common.annotations.VisibleForTesting;
+
+/**
+ * ContainerReplicator wrapper with additional metrics.
+ */
+@Metrics(about = "Closed container replication metrics", context = "dfs")
+public class MeasuredReplicator implements ContainerReplicator, AutoCloseable {
+
+  private static final String NAME = ContainerReplicator.class.toString();
+
+  private final ContainerReplicator delegate;
+
+  @Metric
+  private MutableCounterLong success;
+
+  @Metric
+  private MutableGaugeLong successTime;
+
+  @Metric
+  private MutableCounterLong failure;
+
+  @Metric
+  private MutableGaugeLong queueTime;
+
+  @Metric
+  private MutableGaugeLong transferredBytes;
+
+  public MeasuredReplicator(ContainerReplicator delegate) {
+    this.delegate = delegate;
+    DefaultMetricsSystem.instance()
+        .register(NAME, "Closed container replication", this);
+  }
+
+  @Override
+  public void replicate(ReplicationTask task) {
+    long start = System.currentTimeMillis();
+
+    long msInQueue =
+        Instant.now().getNano() - task.getQueued().getNano() / 1_000_000;

Review comment:
       OMG.
   
   Fixed, thanks to save me ;-)




----------------------------------------------------------------
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



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


[GitHub] [ozone] adoroszlai merged pull request #1669: HDDS-4460. Add metrics for closed container replication

Posted by GitBox <gi...@apache.org>.
adoroszlai merged pull request #1669:
URL: https://github.com/apache/ozone/pull/1669


   


----------------------------------------------------------------
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



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


[GitHub] [ozone] adoroszlai commented on pull request #1669: HDDS-4460. Add metrics for closed container replication

Posted by GitBox <gi...@apache.org>.
adoroszlai commented on pull request #1669:
URL: https://github.com/apache/ozone/pull/1669#issuecomment-773052882


   Thanks @elek for the patch and @jojochuang for the review.


----------------------------------------------------------------
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



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


[GitHub] [ozone] jojochuang commented on a change in pull request #1669: HDDS-4460. Add metrics for closed container replication

Posted by GitBox <gi...@apache.org>.
jojochuang commented on a change in pull request #1669:
URL: https://github.com/apache/ozone/pull/1669#discussion_r540549830



##########
File path: hadoop-hdds/container-service/src/main/java/org/apache/hadoop/ozone/container/replication/MeasuredReplicator.java
##########
@@ -0,0 +1,109 @@
+/*
+ * 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
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * 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.container.replication;
+
+import java.time.Instant;
+
+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.MutableGaugeLong;
+import org.apache.hadoop.ozone.container.replication.ReplicationTask.Status;
+
+import com.google.common.annotations.VisibleForTesting;
+
+/**
+ * ContainerReplicator wrapper with additional metrics.
+ */
+@Metrics(about = "Closed container replication metrics", context = "dfs")
+public class MeasuredReplicator implements ContainerReplicator, AutoCloseable {
+
+  private static final String NAME = ContainerReplicator.class.toString();
+
+  private final ContainerReplicator delegate;
+
+  @Metric
+  private MutableCounterLong success;
+
+  @Metric
+  private MutableGaugeLong successTime;
+
+  @Metric
+  private MutableCounterLong failure;
+
+  @Metric
+  private MutableGaugeLong queueTime;
+
+  @Metric
+  private MutableGaugeLong transferredBytes;
+
+  public MeasuredReplicator(ContainerReplicator delegate) {
+    this.delegate = delegate;
+    DefaultMetricsSystem.instance()
+        .register(NAME, "Closed container replication", this);
+  }
+
+  @Override
+  public void replicate(ReplicationTask task) {
+    long start = System.currentTimeMillis();
+
+    long msInQueue =
+        Instant.now().getNano() - task.getQueued().getNano() / 1_000_000;

Review comment:
       did you forget a pair of brackets here? Like 
   ```
   (Instant.now().getNano() - task.getQueued().getNano()) / 1_000_000;
   ```




----------------------------------------------------------------
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



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