Github user anmolnar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/307#discussion_r191202605
--- Diff: src/java/main/org/apache/zookeeper/server/ServerStats.java ---
@@ -148,9 +174,46 @@ synchronized public void resetRequestCounters(){
packetsReceived = 0;
packetsSent = 0;
}
+ synchronized public void resetNumRequestsAboveThresholdTime() {
+ numRequestsAboveThresholdTime = 0;
+ }
synchronized public void reset() {
resetLatency();
resetRequestCounters();
+ resetNumRequestsAboveThresholdTime();
+ }
+
+ public void checkLatency(final ZooKeeperServer zks, Request request) {
--- End diff --
IMO, this method could be private and called from `updateLatency()`.
Basically you don't want to miss any latency update calls, hence it makes sense
to put the call there. Any objections?
---