jhuan31 commented on a change in pull request #840: ZOOKEEPER-3143 Pluggable
metrics system for ZooKeeper - Data Collection on Server
URL: https://github.com/apache/zookeeper/pull/840#discussion_r264047288
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/watch/WatchManagerOptimized.java
##########
@@ -68,6 +68,8 @@
private final WatcherCleaner watcherCleaner;
private final ReentrantReadWriteLock addRemovePathRWLock = new
ReentrantReadWriteLock();
+
+ private ServerMetrics serverMetrics = ServerMetrics.NULL_METRICS;
Review comment:
Yeah, using NULL_METRICS is a clever idea. But in the case I want to record
real metrics, where should I set the proper serverMetrics instance? In
WatcherManagerFactory where the WatchManager is instantiated? Then we need to
pass the serverMetrics into WatcherManagerFactory, which is called from
DataTree and we will need to pass the serverMetrics into DataTree... This
smells like an aspect/injection framework...
I went through previous comments and code changes for the pluggable metrics
system and still feel that I missed something. So please bear with my stupid
questions. Is the single instance of server metrics intended for the whole
server, or one for each class (like the logger), or one for each object
(unlikely)?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services