You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by GitBox <gi...@apache.org> on 2020/03/03 05:07:57 UTC

[GitHub] [storm] Ethanlm commented on a change in pull request #3194: [STORM-3565] add support for adding dimensions to metric data points

Ethanlm commented on a change in pull request #3194: [STORM-3565] add support for adding dimensions to metric data points
URL: https://github.com/apache/storm/pull/3194#discussion_r386801652
 
 

 ##########
 File path: storm-client/src/jvm/org/apache/storm/metric/api/IMetric.java
 ##########
 @@ -12,16 +12,39 @@
 
 package org.apache.storm.metric.api;
 
+import java.util.Collections;
+import java.util.Map;
+
 /**
  * Produces metrics.
+ * Usually, metric is a measurement identified by a name string.
+ * Dimensions are a collection of additional key-value metadata map containing extra information of this measurement.
+ * It is optional when customizing your metric by implementing this interface
  */
 public interface IMetric {
     /**
      * Get value and reset.
-     * @return an object that will be sent sent to {@link IMetricsConsumer#handleDataPoints(org.apache.storm.metric.api.IMetricsConsumer
-     * .TaskInfo,
-     *     java.util.Collection)}. If null is returned nothing will be sent. If this value can be reset, like with a counter, a side effect
+     * @return an object that will be sent to
+     *     {@link IMetricsConsumer#handleDataPoints(org.apache.storm.metric.api.IMetricsConsumer.TaskInfo, java.util.Collection)}.
+     *     If null is returned nothing will be sent. If this value can be reset, like with a counter, a side effect
      *     of calling this should be that the value is reset.
      */
     Object getValueAndReset();
+
+
+    /**
+     * Check whether this metric is carrying additional dimension map.
+     * @return a boolean value.
+     */
+    default boolean isDimensional() {
 
 Review comment:
   Why do we need this function?

----------------------------------------------------------------
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