Github user revans2 commented on a diff in the pull request:
https://github.com/apache/incubator-storm/pull/38#discussion_r10345154
--- Diff: storm-core/src/jvm/backtype/storm/task/TopologyContext.java ---
@@ -251,6 +253,30 @@ public void addTaskHook(ITaskHook hook) {
return metric;
}
+ /**
+ * Get component's metric from registered metrics by name.
+ * Notice: Normally, one component can only register one metric name
once.
+ * But now registerMetric has a
bug(https://issues.apache.org/jira/browse/STORM-254)
+ * cause the same metric name can register twice.
+ * So we just return the first metric we meet.
+ */
+ public IMetric getRegisteredMetricByName(String name) {
--- End diff --
I am a little concerned about the performance of this method, but we can
address it if it turns out to be an issue.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---