You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@zookeeper.apache.org by anmolnar <gi...@git.apache.org> on 2018/09/04 10:03:54 UTC

[GitHub] zookeeper pull request #580: ZOOKEEPER-3098: Add additional server metrics

Github user anmolnar commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/580#discussion_r214857251
  
    --- Diff: src/java/main/org/apache/zookeeper/server/ServerStats.java ---
    @@ -33,17 +34,17 @@
     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 final AtomicLong packetsSent = new AtomicLong();
    --- End diff --
    
    I'm not sure if I see what you mean by "being counted"?
    I've thought that these three metrics should be part of ServerMetrics as:
    - packetsSent and packetsReceived as SimpleCounter,
    - requestLatency as AvgMinMaxCounter
    
    and should be referred as ServerMetrics.PACKETS_SENT, etc. like the rest.
    Please let me know if didn't get it right.


---