zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maoling <...@git.apache.org>
Subject [GitHub] zookeeper pull request #629: ZOOKEEPER-2641:AvgRequestLatency metric improve...
Date Fri, 21 Sep 2018 10:14:22 GMT
Github user maoling commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/629#discussion_r219449556
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ServerStats.java ---
    @@ -53,10 +53,11 @@ public ServerStats(Provider provider) {
         synchronized public long getMinLatency() {
             return minLatency == Long.MAX_VALUE ? 0 : minLatency;
         }
    -
    -    synchronized public long getAvgLatency() {
    +    
    +    synchronized public double getAvgLatency() {
             if (count != 0) {
    -            return totalLatency / count;
    +            //be account to four decimal places
    +            return (totalLatency * 10000 / count) / 10000.0;
    --- End diff --
    
    @lvfangmin I test it in my local and find no complain(findbugs version 3.0.1)
    where can I find the warnings?


---

Mime
View raw message