You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@storm.apache.org by "Rick Kellogg (JIRA)" <ji...@apache.org> on 2015/10/09 02:46:26 UTC
[jira] [Updated] (STORM-254) one Spout/Bolt can register metric
twice with same name
[ https://issues.apache.org/jira/browse/STORM-254?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rick Kellogg updated STORM-254:
-------------------------------
Component/s: storm-core
> 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
> Issue Type: Bug
> Components: storm-core
> Affects Versions: 0.9.2-incubating
> Reporter: DashengJu
> Assignee: DashengJu
> Fix For: 0.9.3
>
> 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.3.4#6332)