[ 
https://issues.apache.org/jira/browse/STORM-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14065566#comment-14065566
 ] 

ASF GitHub Bot commented on STORM-254:
--------------------------------------

Github user revans2 commented on the pull request:

    https://github.com/apache/incubator-storm/pull/176#issuecomment-49367057
  
    I am sorry it has taken me so long to look at this.  The code change looks 
good.  It would be nice to have a unit test for this, but I don't think it is 
that critical.  I am +1 for this.


> one Spout/Bolt can register metric twice with same name
> -------------------------------------------------------
>
>                 Key: STORM-254
>                 URL: https://issues.apache.org/jira/browse/STORM-254
>             Project: Apache Storm (Incubating)
>          Issue Type: Bug
>    Affects Versions: 0.9.2-incubating
>            Reporter: DashengJu
>   Original Estimate: 12h
>  Remaining Estimate: 12h
>
> 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();
>       
>       cMetric = new MTCountMetric();
>       context.registerMetric("JavaBoltCount", cMetric, 120);
>       ccMetric = new MTCountMetric();
>       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



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to