ctubbsii closed pull request #553: Correct display of BulkImport duration in 
monitor
URL: https://github.com/apache/accumulo/pull/553
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/core/src/main/java/org/apache/accumulo/core/util/Duration.java 
b/core/src/main/java/org/apache/accumulo/core/util/Duration.java
index b1b85728f6..142c2b4cf9 100644
--- a/core/src/main/java/org/apache/accumulo/core/util/Duration.java
+++ b/core/src/main/java/org/apache/accumulo/core/util/Duration.java
@@ -19,11 +19,7 @@
 public class Duration {
 
   public static String format(long time) {
-    return format(time, " ");
-  }
-
-  public static String format(long time, String space) {
-    return format(time, space, "—");
+    return format(time, " ", "—");
   }
 
   public static String format(long time, String space, String zero) {
diff --git 
a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BulkImportServlet.java
 
b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BulkImportServlet.java
index 3e41218765..f5c1447ba8 100644
--- 
a/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BulkImportServlet.java
+++ 
b/server/monitor/src/main/java/org/apache/accumulo/monitor/servlets/BulkImportServlet.java
@@ -42,7 +42,7 @@ protected String getTitle(HttpServletRequest req) {
   }
 
   static private long duration(long start) {
-    return (System.currentTimeMillis() - start) / 1000L;
+    return System.currentTimeMillis() - start;
   }
 
   @Override
diff --git 
a/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/DurationType.java
 
b/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/DurationType.java
index f1ba9ed79f..d054419fd2 100644
--- 
a/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/DurationType.java
+++ 
b/server/monitor/src/main/java/org/apache/accumulo/monitor/util/celltypes/DurationType.java
@@ -37,16 +37,13 @@ public String format(Object obj) {
     if (obj == null)
       return "-";
     Long millis = (Long) obj;
-    if (errMin != null && errMax != null)
-      return seconds(millis, errMin, errMax);
+    if (errMin != null && errMax != null) {
+      String numbers = Duration.format(millis);
+      if (millis < errMin || millis > errMax)
+        return "<span class='error'>" + numbers + "</span>";
+      return numbers;
+    }
     return Duration.format(millis);
   }
 
-  private static String seconds(long secs, long errMin, long errMax) {
-    String numbers = Duration.format(secs);
-    if (secs < errMin || secs > errMax)
-      return "<span class='error'>" + numbers + "</span>";
-    return numbers;
-  }
-
 }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to