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

Liu Shaohui commented on ZOOKEEPER-2290:
----------------------------------------

[~eribeiro]
{quote}
*Also I think it is nice to expose those new metrics via JMX too.*
{quote}
Done in patch v3. Please see the class: ZooKeeperServerBean

{quote}
And you should put a 'default' case in the switch-case statement – throwing a 
IllegalArgumentException
{quote}
Done.

{quote}
 I think getRate() should return a double instead of a long 'cause it will 
round results otherwise. Also, TIMES_SLOT should be final too. I would rename 
it as TIME_SLOT_MS
{quote}
Done.

{quote}
Finally, no need to call updateLatency() on every op type: you can set the 
operation type (READ/WRITE) instead and call updateLatency() at the end. 
{quote}
The preview two updateLatency() are because there are *return* in the switch 
cases. I don't want to change the code structure 


> Add read/write qps metrics in monitor cmd
> -----------------------------------------
>
>                 Key: ZOOKEEPER-2290
>                 URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2290
>             Project: ZooKeeper
>          Issue Type: Improvement
>    Affects Versions: 3.4.6
>            Reporter: Liu Shaohui
>            Priority: Minor
>              Labels: monitor
>             Fix For: 3.6.0
>
>         Attachments: ZOOKEEPER-2290-v1.patch, ZOOKEEPER-2290-v2.patch, 
> ZOOKEEPER-2290-v3.patch
>
>
> Read/write qps are important metrics to show the pressure of the cluster. We 
> can also use it to alert about some abuse of zookeeper.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to