[
https://issues.apache.org/jira/browse/HDFS-15842?focusedWorklogId=612232&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-612232
]
ASF GitHub Bot logged work on HDFS-15842:
-----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Jun/21 00:21
Start Date: 19/Jun/21 00:21
Worklog Time Spent: 10m
Work Description: LeonGao91 commented on a change in pull request #2738:
URL: https://github.com/apache/hadoop/pull/2738#discussion_r654722499
##########
File path:
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/mover/MoverMetrics.java
##########
@@ -0,0 +1,84 @@
+/**
+ * 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.hdfs.server.mover;
+
+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.MutableGaugeInt;
+
+/**
+ * Metrics for HDFS Mover of a blockpool.
+ */
+@Metrics(about="Mover metrics", context="dfs")
+final class MoverMetrics {
+
+ private final Mover mover;
+
+ @Metric("If mover is processing namespace.")
+ private MutableGaugeInt processingNamespace;
+
+ @Metric("Number of blocks being scheduled.")
+ private MutableCounterLong blocksScheduled;
+
+ @Metric("Number of files being processed.")
+ private MutableCounterLong filesProcessed;
+
+ private MoverMetrics(Mover m) {
+ this.mover = m;
+ }
+
+ public static MoverMetrics create(Mover mover) {
+ MoverMetrics m = new MoverMetrics(mover);
+ DefaultMetricsSystem.instance().unregisterSource(m.getName());
Review comment:
You are right, this is not needed here. As discussed I will shutdown
metrics at the end of the mover run
--
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 612232)
Time Spent: 1h 10m (was: 1h)
> HDFS mover to emit metrics
> --------------------------
>
> Key: HDFS-15842
> URL: https://issues.apache.org/jira/browse/HDFS-15842
> Project: Hadoop HDFS
> Issue Type: Improvement
> Components: balancer & mover
> Reporter: Leon Gao
> Assignee: Leon Gao
> Priority: Major
> Labels: pull-request-available
> Time Spent: 1h 10m
> Remaining Estimate: 0h
>
> We can emit metrics thru metrics2 when running HDFS mover, which can help to
> monitor the progress and turn mover parameters.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]