[ 
https://issues.apache.org/jira/browse/ZOOKEEPER-1321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13187069#comment-13187069
 ] 

Henry Robinson commented on ZOOKEEPER-1321:
-------------------------------------------

+1 looks good! Only weirdness to my eyes is the following:

{code}
+    public int getNumAliveConnections() {
+        int numConnections;
+        synchronized(cnxns) {
+            numConnections = cnxns.size();
+        }
+        return numConnections;
+    }
{code}

It's perfectly legal to return inside a synchronized block, so it might be more 
concise to have:

{code}

+    public int getNumAliveConnections() {
+        synchronized(cnxns) {
+            return cnxns.size();
+        }
+    }
{code}

If you fix this nit I'm happy for you to commit this without another review 
pass. 
                
> Add number of client connections metric in JMX and srvr
> -------------------------------------------------------
>
>                 Key: ZOOKEEPER-1321
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1321
>             Project: ZooKeeper
>          Issue Type: Improvement
>    Affects Versions: 3.3.4, 3.4.2
>            Reporter: Neha Narkhede
>            Assignee: Neha Narkhede
>              Labels: patch
>         Attachments: ZOOKEEPER-1321_3.4.patch, ZOOKEEPER-1321_trunk.patch, 
> ZOOKEEPER-1321_trunk.patch, zk-1321-cleanup, zookeeper-1321-trunk-v2.patch
>
>
> The related conversation on the zookeeper user mailing list is here - 
> http://apache.markmail.org/message/4jjcmooniowwugu2?q=+list:org.apache.hadoop.zookeeper-user
> It is useful to be able to monitor the number of disconnect operations on a 
> client. This is generally indicative of a client going through large number 
> of GC and hence disconnecting way too often from a zookeeper cluster. 
> Today, this information is only indirectly exposed as part of the stat 
> command which requires counting the results. That's alot of work for the 
> server to do just to get connection count. 
> For monitoring purposes, it will be useful to have this exposed through JMX 
> and 4lw srvr.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to