You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@accumulo.apache.org by GitBox <gi...@apache.org> on 2019/09/09 19:21:15 UTC

[GitHub] [accumulo] EdColeman commented on a change in pull request #1352: Fix #1345 - Allow gc initiated compaction as option.

EdColeman commented on a change in pull request #1352: Fix #1345 - Allow gc initiated compaction as option.
URL: https://github.com/apache/accumulo/pull/1352#discussion_r322411782
 
 

 ##########
 File path: server/gc/src/main/java/org/apache/accumulo/gc/SimpleGarbageCollector.java
 ##########
 @@ -614,8 +613,9 @@ public void update(LiveTServerSet current, Set<TServerInstance> deleted,
         log.error("{}", e.getMessage(), e);
       }
 
-      tStop = System.currentTimeMillis();
-      log.info(String.format("Collect cycle took %.2f seconds", ((tStop - tStart) / 1000.0)));
+      final long tStop = System.nanoTime();
+      log.info(String.format("Collect cycle took %.2f seconds",
+          (TimeUnit.NANOSECONDS.toMillis(tStop - tStart) / 1000.0)));
 
 Review comment:
   I wanted to preserve the fractional seconds.  Using TimeUnits.X.toSeconds() would just truncate.  The other option could be to use 100ths (or something) and round, but the existing log statements were of the form xxx.## - which seemed a reasonable thing to keep .

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services