zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eribeiro <...@git.apache.org>
Subject [GitHub] zookeeper pull request #307: ZOOKEEPER-2770 ZooKeeper slow operation log
Date Sat, 21 Oct 2017 15:43:17 GMT
Github user eribeiro commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/307#discussion_r146108249
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ServerStats.java ---
    @@ -21,17 +21,32 @@
     
     
     import org.apache.zookeeper.common.Time;
    +import org.apache.zookeeper.server.quorum.QuorumPeerConfig;
    +import org.slf4j.Logger;
    +import org.slf4j.LoggerFactory;
    +
    +import java.util.Timer;
    +import java.util.TimerTask;
     
     /**
      * Basic Server Statistics
      */
     public class ServerStats {
    +    private static final Logger LOG = LoggerFactory.getLogger(ServerStats.class);
    +
         private long packetsSent;
         private long packetsReceived;
         private long maxLatency;
         private long minLatency = Long.MAX_VALUE;
         private long totalLatency = 0;
         private long count = 0;
    +    private long numRequestsAboveThresholdTime = 0;
    +
    +    final static long requestWarnThresholdMs = QuorumPeerConfig.getRequestWarnResponseThresholdMs();
    +    final static Timer timer = new Timer();
    +    volatile Boolean waitForLoggingWarnThresholdMsg = false;
    --- End diff --
    
    What is the reason to make `waitForLoggingWarnThresholdMsg` a boxed type instead of a
primitive `boolean`?


---

Mime
View raw message