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 2021/09/30 18:11:53 UTC

[GitHub] [accumulo] ctubbsii commented on a change in pull request #2294: Improve fetching scans and compactions in Monitor

ctubbsii commented on a change in pull request #2294:
URL: https://github.com/apache/accumulo/pull/2294#discussion_r719637920



##########
File path: server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
##########
@@ -577,63 +556,79 @@ private ServletHolder getRestServlet() {
         oldest = Math.max(oldest, a.age);
       }
       this.oldest = oldest < 0 ? null : oldest;
+      // use clock time for date friendly display
       this.fetched = System.currentTimeMillis();
     }
   }
 
   private final Map<HostAndPort,ScanStats> allScans = new HashMap<>();
   private final Map<HostAndPort,CompactionStats> allCompactions = new HashMap<>();
   private final RecentLogs recentLogs = new RecentLogs();
+  private long scansFetchedNanos = 0L;
+  private long compactsFetchedNanos = 0L;
+  private final long fetchTimeNanos = TimeUnit.NANOSECONDS.convert(1, TimeUnit.MINUTES);
+  private final long ageOffEntriesMillis = TimeUnit.MILLISECONDS.convert(15, TimeUnit.MINUTES);

Review comment:
       Small nit: TimeUnit has a `convert` method, but also has a series of `to<Unit>` methods that are more explicit. The `convert` method can be sometimes confusing, because it's not obvious the direction in which you're doing the converting. In general, I recommend the use of the more explicit `toNanos` and `toMillis`, etc. methods instead of `convert`.




-- 
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.

To unsubscribe, e-mail: notifications-unsubscribe@accumulo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org