GitHub user dashengju opened a pull request:
https://github.com/apache/incubator-storm/pull/176
[STORM-254] one Spout/Bolt can register metric twice with same name in
different timeBucket
In a Bolt's prepare method, we can register metrics twice with the same
name, using different timeBucketSizeInSecs parameter, like this:
---------------------------------------------------------------------------------------
public void prepare(Map stormConf, TopologyContext context)
{
mapper = new ObjectMapper();
CountMetric cMetric = new CountMetric();
context.registerMetric("JavaBoltCount", cMetric, 120);
CountMetric ccMetric = new CountMetric();
context.registerMetric("JavaBoltCount", ccMetric, 60);
}
----------------------------------------------------------------------------------------
This is caused by TopologyContext's registerMetric.
In TopologyContext, all registered metrics holds in a map defined below:
private Map<Integer,Map<Integer, Map<String, IMetric>>> _registeredMetrics;
timeBucketSizeInSecs ----> __taskId ----> metricName ----> metirc
But the same name check just at the innermost layer.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/dashengju/incubator-storm
upstream_master_storm254
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/incubator-storm/pull/176.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #176
----
commit f8c9995ac7f1d5fcdd19b3d0f67f0abd111f320e
Author: dashengju <[email protected]>
Date: 2014-07-02T15:32:30Z
resolve storm-254, fobbiden to register same name metrics in different
timeBucket
----
---
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.
---