You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pulsar.apache.org by gi...@git.apache.org on 2017/07/11 00:17:53 UTC

[GitHub] rdhabalia commented on a change in pull request #507: Add zk-stats instrumentation to get zk-client stats

rdhabalia commented on a change in pull request #507: Add zk-stats instrumentation to get zk-client stats
URL: https://github.com/apache/incubator-pulsar/pull/507#discussion_r126568313
 
 

 ##########
 File path: pulsar-broker/src/main/java/org/apache/pulsar/broker/service/BrokerService.java
 ##########
 @@ -189,6 +190,10 @@ public BrokerService(PulsarService pulsar) throws Exception {
 
         this.multiLayerTopicsMap = new ConcurrentOpenHashMap<>();
         this.pulsarStats = new PulsarStats(pulsar);
+        // register listener to capture zk-latency
+        ClientCnxnAspect.addListner((eventType, latencyMs) -> {
+            this.pulsarStats.recordZkLatencyTimeValue(eventType, latencyMs);
 
 Review comment:
   Actually, right now, we are using BK-Yahoo version where [BK-ZK-Client](https://github.com/yahoo/bookkeeper/blob/yahoo-4.3/bookkeeper-server/src/main/java/org/apache/bookkeeper/zookeeper/ZooWorker.java) captures startTime in Msec and it doesn't have OpStatsLoggger yet. And it seems both the things are fixed in [BK-master](https://github.com/apache/bookkeeper/blob/master/bookkeeper-server/src/main/java/org/apache/bookkeeper/zookeeper/ZooWorker.java). 
   Therefore, startTime is milliseconds, it's not possible to capture time < 1 msec for now. We can do it once we move to latest BK version.
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services