zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] lvfangmin commented on a change in pull request #854: ZOOKEEPER-3143 Pluggable metrics system for ZooKeeper - Data Collection on Server
Date Thu, 21 Mar 2019 18:06:21 GMT
lvfangmin commented on a change in pull request #854: ZOOKEEPER-3143 Pluggable metrics system
for ZooKeeper - Data Collection on Server
URL: https://github.com/apache/zookeeper/pull/854#discussion_r267890440
 
 

 ##########
 File path: zookeeper-server/src/main/java/org/apache/zookeeper/metrics/MetricsContext.java
 ##########
 @@ -50,22 +50,48 @@
     Counter getCounter(String name);
 
     /**
-     * Registers an user provided {@link Gauge} which will be called by the MetricsProvider
in order to sample
-     * an integer value.
+     * Registers an user provided {@link Gauge} which will be called by the
+     * MetricsProvider in order to sample an integer value.
      *
      * @param name unique name of the Gauge in this context
      * @param gauge the implementation of the Gauge
      *
-     * @return true if the Gauge was successfully registered, false if the Gauge was already
registered.
+     * @return true if the Gauge was successfully registered, false if the Gauge
+     * was already registered.
      */
     boolean registerGauge(String name, Gauge gauge);
 
+    static enum DetailLevel {
+        /**
+         * The returned Summary is expected to track only simple aggregated
+         * values, like min/max/avg
+         */
+        BASIC,
+        /**
+         * It is expected that the returned Summary performs expensive
+         * aggregations, like percentiles.
+         */
+        ADVANCED
+    }
+
     /**
      * Returns a summary.
      *
      * @param name
+     * @param detailLevel
+     * @return the summary identified by name in this context.
+     * @see #getSummary(java.lang.String)
+     */
+    Summary getSummary(String name, DetailLevel detailLevel);
+
+    /**
+     * Returns a set of summaries.
+     *
+     * @param name
+     * @param detailLevel
      * @return the summary identified by name in this context.
+     * @see #getSummary(java.lang.String)
      */
-    Summary getSummary(String name);
+    SummarySet getSummarySet(String name, DetailLevel detailLevel);
 
 Review comment:
   @jhuan31 do you think this is flexible enough to represent the rest of metrics we have
internally?

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services

Mime
View raw message