Github user lvfangmin commented on a diff in the pull request: https://github.com/apache/zookeeper/pull/580#discussion_r212103989 --- Diff: src/java/main/org/apache/zookeeper/server/ServerStats.java --- @@ -127,36 +129,45 @@ public String toString(){ sb.append("Mode: " + getServerState() + "\n"); return sb.toString(); } - // mutators - synchronized void updateLatency(long requestCreateTime) { - long latency = Time.currentElapsedTime() - requestCreateTime; - totalLatency += latency; - count++; - if (latency < minLatency) { - minLatency = latency; + + /** + * Update request statistic. This should only be called from a request + * that originated from that machine. + */ + public void updateLatency(Request request, long currentTime) { --- End diff -- Agree, we don't have to pass in the currentTime here, no test is calling this function.
---