hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a..@apache.org
Subject [16/34] hadoop git commit: HDFS-9882. Add heartbeatsTotal in Datanode metrics. (Contributed by Hua Liu)
Date Wed, 09 Mar 2016 17:45:16 GMT
HDFS-9882. Add heartbeatsTotal in Datanode metrics. (Contributed by Hua Liu)


Project: http://git-wip-us.apache.org/repos/asf/hadoop/repo
Commit: http://git-wip-us.apache.org/repos/asf/hadoop/commit/c2140d05
Tree: http://git-wip-us.apache.org/repos/asf/hadoop/tree/c2140d05
Diff: http://git-wip-us.apache.org/repos/asf/hadoop/diff/c2140d05

Branch: refs/heads/HDFS-1312
Commit: c2140d05efaf18b41caae8c61d9f6d668ab0e874
Parents: 49eedc7
Author: Arpit Agarwal <arp@apache.org>
Authored: Mon Mar 7 21:10:24 2016 -0800
Committer: Arpit Agarwal <arp@apache.org>
Committed: Mon Mar 7 21:10:24 2016 -0800

----------------------------------------------------------------------
 .../hadoop-common/src/site/markdown/Metrics.md                  | 2 ++
 .../org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java  | 5 +++++
 .../hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java    | 5 +++++
 3 files changed, 12 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/c2140d05/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md
----------------------------------------------------------------------
diff --git a/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md b/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md
index b660b16..699316f 100644
--- a/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md
+++ b/hadoop-common-project/hadoop-common/src/site/markdown/Metrics.md
@@ -290,6 +290,8 @@ Each metrics record contains tags such as SessionId and Hostname as additional
i
 | `ReplaceBlockOpAvgTime` | Average time of block replace operations in milliseconds |
 | `HeartbeatsNumOps` | Total number of heartbeats |
 | `HeartbeatsAvgTime` | Average heartbeat time in milliseconds |
+| `HeartbeatsTotalNumOps` | Total number of heartbeats which is a duplicate of HeartbeatsNumOps
|
+| `HeartbeatsTotalAvgTime` | Average total heartbeat time in milliseconds |
 | `LifelinesNumOps` | Total number of lifeline messages |
 | `LifelinesAvgTime` | Average lifeline message processing time in milliseconds |
 | `BlockReportsNumOps` | Total number of block report operations |

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c2140d05/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
index 7184a49..49f64c2 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BPServiceActor.java
@@ -607,6 +607,11 @@ class BPServiceActor implements Runnable {
           processCommand(new DatanodeCommand[]{ cmd });
         }
 
+        if (sendHeartbeat) {
+          dn.getMetrics().addHeartbeatTotal(
+              scheduler.monotonicNow() - startTime);
+        }
+
         // There is no work to do;  sleep until hearbeat timer elapses, 
         // or work arrives, and then iterate again.
         ibrManager.waitTillNextIBR(scheduler.getHeartbeatWaitTime());

http://git-wip-us.apache.org/repos/asf/hadoop/blob/c2140d05/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
index aa518fb..085762b 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
+++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/metrics/DataNodeMetrics.java
@@ -107,6 +107,7 @@ public class DataNodeMetrics {
   @Metric MutableRate copyBlockOp;
   @Metric MutableRate replaceBlockOp;
   @Metric MutableRate heartbeats;
+  @Metric MutableRate heartbeatsTotal;
   @Metric MutableRate lifelines;
   @Metric MutableRate blockReports;
   @Metric MutableRate incrementalBlockReports;
@@ -200,6 +201,10 @@ public class DataNodeMetrics {
     heartbeats.add(latency);
   }
 
+  public void addHeartbeatTotal(long latency) {
+    heartbeatsTotal.add(latency);
+  }
+
   public void addLifeline(long latency) {
     lifelines.add(latency);
   }


Mime
View raw message