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/01/14 16:05:31 UTC
[GitHub] [storm] RuiLi8080 opened a new pull request #3194: [STORM-3565] add
support for adding dimensions to metric data points
RuiLi8080 opened a new pull request #3194: [STORM-3565] add support for adding dimensions to metric data points
URL: https://github.com/apache/storm/pull/3194
A dimensional metric collects information into multiple sub-categories (dimensions).
Add an interface `IDimensionalMetric` extending `IMetric` in hope for supporting a better fine-grained metric reporting.
`DimensionalCountMetric` serves as an example for creating and using dimensional metric
----------------------------------------------------------------
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
[GitHub] [storm] kishorvpatil commented on a change in pull request #3194:
[STORM-3565] add support for adding dimensions to metric data points
Posted by GitBox <gi...@apache.org>.
kishorvpatil 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_r367405335
##########
File path: storm-client/src/jvm/org/apache/storm/metric/api/IDimensionalMetric.java
##########
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+
+package org.apache.storm.metric.api;
+
+import java.util.Map;
+
+public interface IDimensionalMetric extends IMetric {
+
+ /**
+ * Dimensions is a collection of additional key-value metadata which is optional.
+ * It could be useful for further fine-grained measurement for a metric.
+ * It may also help better grouping in downstream metric monitoring system.
+ *
+ * @return a map of dimension name to a sub-metric
+ */
+ Map<Map<String, String>, CountMetric> getDimToMetric(); // dimensions : sub-metric
Review comment:
Using `CountMetric` makes this interface specific to `CountMetric`.
----------------------------------------------------------------
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
[GitHub] [storm] Ethanlm commented on a change in pull request #3194:
[STORM-3565] add support for adding dimensions to metric data points
Posted by GitBox <gi...@apache.org>.
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
[GitHub] [storm] RuiLi8080 commented on a change in pull request #3194:
[STORM-3565] add support for adding dimensions to metric data points
Posted by GitBox <gi...@apache.org>.
RuiLi8080 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_r367519577
##########
File path: storm-client/src/jvm/org/apache/storm/metric/api/IDimensionalMetric.java
##########
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version
+ * 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
+ * and limitations under the License.
+ */
+
+package org.apache.storm.metric.api;
+
+import java.util.Map;
+
+public interface IDimensionalMetric extends IMetric {
+
+ /**
+ * Dimensions is a collection of additional key-value metadata which is optional.
+ * It could be useful for further fine-grained measurement for a metric.
+ * It may also help better grouping in downstream metric monitoring system.
+ *
+ * @return a map of dimension name to a sub-metric
+ */
+ Map<Map<String, String>, CountMetric> getDimToMetric(); // dimensions : sub-metric
Review comment:
@kishorvpatil My mistake, thank you for pointing out. My intention was to set this to IMetric. When implementing, map value could be dynamically typed by implementing IMetric. Corrected.
----------------------------------------------------------------
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
[GitHub] [storm] kishorvpatil commented on issue #3194: [STORM-3565] add
support for adding dimensions to metric data points
Posted by GitBox <gi...@apache.org>.
kishorvpatil commented on issue #3194: [STORM-3565] add support for adding dimensions to metric data points
URL: https://github.com/apache/storm/pull/3194#issuecomment-574907261
Having _DimensionalCountMetric_ is excluding all other IMetric implementations that would required Dimensional implementation.
----------------------------------------------------------------
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
[GitHub] [storm] RuiLi8080 commented on issue #3194: [STORM-3565] add
support for adding dimensions to metric data points
Posted by GitBox <gi...@apache.org>.
RuiLi8080 commented on issue #3194: [STORM-3565] add support for adding dimensions to metric data points
URL: https://github.com/apache/storm/pull/3194#issuecomment-580324029
Re-worked on this PR. My thinking is to add a dimensions field in IMetricConsumer.DataPoint as an additional K-V metadata map. Data points are collected from metric measurement. The optional additional information could be helpful when downstream monitoring system want to organize or group those datapoints.
----------------------------------------------------------------
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