Github user anmolnar commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/580#discussion_r214857350
--- 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 --
@jtuple Please remove `currentTime` from here.
---