This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/2.1 by this push:
     new ae94980767 fixes nanoTime bug in Monitor (#4884)
ae94980767 is described below

commit ae949807678f63e3be56219632a1c04cc3e63fd2
Author: Keith Turner <ktur...@apache.org>
AuthorDate: Fri Sep 13 13:38:39 2024 -0400

    fixes nanoTime bug in Monitor (#4884)
    
    Variables used with nanoTime were being initialized to zero.  If
    nanoTime were negative it would lead to the elasped time computation
    with these variables always being negative. Initialized the variables
    using nanoTime instead of zero to fix the elapsed time computation.
---
 .../monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java  | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 
a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java 
b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
index 23ffb5391f..9957164153 100644
--- a/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
+++ b/server/monitor/src/main/java/org/apache/accumulo/monitor/Monitor.java
@@ -618,9 +618,9 @@ public class Monitor extends AbstractServer implements 
HighlyAvailableService {
   private final RecentLogs recentLogs = new RecentLogs();
   private final ExternalCompactionInfo ecInfo = new ExternalCompactionInfo();
 
-  private long scansFetchedNanos = 0L;
-  private long compactsFetchedNanos = 0L;
-  private long ecInfoFetchedNanos = 0L;
+  private long scansFetchedNanos = System.nanoTime();
+  private long compactsFetchedNanos = System.nanoTime();
+  private long ecInfoFetchedNanos = System.nanoTime();
   private final long fetchTimeNanos = TimeUnit.MINUTES.toNanos(1);
   private final long ageOffEntriesMillis = TimeUnit.MINUTES.toMillis(15);
   // When there are a large amount of external compactions running the list of 
external compactions

Reply via email to