hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From whe...@apache.org
Subject hadoop git commit: HDFS-9153. Pretty-format the output for DFSIO. Contributed by Kai Zheng.
Date Mon, 23 Nov 2015 00:19:58 GMT
Repository: hadoop
Updated Branches:
  refs/heads/branch-2 049ccf71c -> 469fef2a4


HDFS-9153. Pretty-format the output for DFSIO. Contributed by Kai Zheng.


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

Branch: refs/heads/branch-2
Commit: 469fef2a4fbff041dde7253f269898f9810a21da
Parents: 049ccf7
Author: Haohui Mai <wheat9@apache.org>
Authored: Sun Nov 22 16:18:07 2015 -0800
Committer: Haohui Mai <wheat9@apache.org>
Committed: Sun Nov 22 16:18:16 2015 -0800

----------------------------------------------------------------------
 hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt     |  2 ++
 .../java/org/apache/hadoop/fs/TestDFSIO.java    | 23 +++++++++++---------
 2 files changed, 15 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hadoop/blob/469fef2a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
----------------------------------------------------------------------
diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
index be90287..f3ec788 100644
--- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
+++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
@@ -806,6 +806,8 @@ Release 2.8.0 - UNRELEASED
 
     HDFS-9402. Switch DataNode.LOG to use slf4j. (Walter Su via wheat9)
 
+    HDFS-9153. Pretty-format the output for DFSIO. (Kai Zheng via wheat9)
+
   OPTIMIZATIONS
 
     HDFS-8026. Trace FSOutputSummer#writeChecksumChunks rather than

http://git-wip-us.apache.org/repos/asf/hadoop/blob/469fef2a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
----------------------------------------------------------------------
diff --git a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
index 53997e7..51f58e0 100644
--- a/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
+++ b/hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient/src/test/java/org/apache/hadoop/fs/TestDFSIO.java
@@ -28,6 +28,7 @@ import java.io.InputStream;
 import java.io.InputStreamReader;
 import java.io.OutputStream;
 import java.io.PrintStream;
+import java.text.DecimalFormat;
 import java.util.Date;
 import java.util.Random;
 import java.util.StringTokenizer;
@@ -903,19 +904,21 @@ public class TestDFSIO implements Tool {
       if(in != null) in.close();
       if(lines != null) lines.close();
     }
-    
+
     double med = rate / 1000 / tasks;
     double stdDev = Math.sqrt(Math.abs(sqrate / 1000 / tasks - med*med));
+    DecimalFormat df = new DecimalFormat("#.##");
     String resultLines[] = {
-      "----- TestDFSIO ----- : " + testType,
-      "           Date & time: " + new Date(System.currentTimeMillis()),
-      "       Number of files: " + tasks,
-      "Total MBytes processed: " + toMB(size),
-      "     Throughput mb/sec: " + size * 1000.0 / (time * MEGA),
-      "Average IO rate mb/sec: " + med,
-      " IO rate std deviation: " + stdDev,
-      "    Test exec time sec: " + (float)execTime / 1000,
-      "" };
+        "----- TestDFSIO ----- : " + testType,
+        "            Date & time: " + new Date(System.currentTimeMillis()),
+        "        Number of files: " + tasks,
+        " Total MBytes processed: " + df.format(toMB(size)),
+        "      Throughput mb/sec: " + df.format(size * 1000.0 / (time * MEGA)),
+        "Total Throughput mb/sec: " + df.format(toMB(size) / ((float)execTime)),
+        " Average IO rate mb/sec: " + df.format(med),
+        "  IO rate std deviation: " + df.format(stdDev),
+        "     Test exec time sec: " + df.format((float)execTime / 1000),
+        "" };
 
     PrintStream res = null;
     try {


Mime
View raw message