accumulo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ctubb...@apache.org
Subject [accumulo] branch 1.9 updated: Fix #551 Correct display of BulkImport duration in monitor (#553)
Date Fri, 06 Jul 2018 15:23:08 GMT
This is an automated email from the ASF dual-hosted git repository.

ctubbsii pushed a commit to branch 1.9
in repository https://gitbox.apache.org/repos/asf/accumulo.git


The following commit(s) were added to refs/heads/1.9 by this push:
     new 2ee5f49  Fix #551 Correct display of BulkImport duration in monitor (#553)
2ee5f49 is described below

commit 2ee5f4916f59aaf485ae15099e765bc08c3ae141
Author: EdColeman <dev1@etcoleman.com>
AuthorDate: Fri Jul 6 11:23:05 2018 -0400

    Fix #551 Correct display of BulkImport duration in monitor (#553)
    
    The formatting for monitor display accepts milliseconds. This
    fix corrects issue where seconds (duration / 1000) were used,
    causing the duration displayed by the monitor to format and display
    incorrectly.
---
 .../main/java/org/apache/accumulo/core/util/Duration.java |  6 +-----
 .../accumulo/monitor/servlets/BulkImportServlet.java      |  2 +-
 .../accumulo/monitor/util/celltypes/DurationType.java     | 15 ++++++---------
 3 files changed, 8 insertions(+), 15 deletions(-)

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 b1b8572..142c2b4 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 @@ package org.apache.accumulo.core.util;
 public class Duration {
 
   public static String format(long time) {
-    return format(time, "&nbsp;");
-  }
-
-  public static String format(long time, String space) {
-    return format(time, space, "&mdash;");
+    return format(time, "&nbsp;", "&mdash;");
   }
 
   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 3e41218..f5c1447 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 @@ public class BulkImportServlet extends BasicServlet {
   }
 
   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 f1ba9ed..d054419 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 class DurationType extends NumberType<Long> {
     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;
-  }
-
 }


Mime
View raw message