Return-Path: X-Original-To: apmail-storm-dev-archive@minotaur.apache.org Delivered-To: apmail-storm-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0985911967 for ; Wed, 2 Jul 2014 15:42:48 +0000 (UTC) Received: (qmail 36677 invoked by uid 500); 2 Jul 2014 15:42:47 -0000 Delivered-To: apmail-storm-dev-archive@storm.apache.org Received: (qmail 36631 invoked by uid 500); 2 Jul 2014 15:42:47 -0000 Mailing-List: contact dev-help@storm.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@storm.incubator.apache.org Delivered-To: mailing list dev@storm.incubator.apache.org Received: (qmail 36585 invoked by uid 99); 2 Jul 2014 15:42:47 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 15:42:47 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO mail.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 02 Jul 2014 15:42:46 +0000 Received: (qmail 35044 invoked by uid 99); 2 Jul 2014 15:42:26 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 02 Jul 2014 15:42:26 +0000 Date: Wed, 2 Jul 2014 15:42:26 +0000 (UTC) From: "ASF GitHub Bot (JIRA)" To: dev@storm.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (STORM-254) one Spout/Bolt can register metric twice with same name MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/STORM-254?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14050057#comment-14050057 ] ASF GitHub Bot commented on STORM-254: -------------------------------------- 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>> _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 Date: 2014-07-02T15:32:30Z resolve storm-254, fobbiden to register same name metrics in different timeBucket ---- > 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>> _registeredMetrics; > timeBucketSizeInSecs ----> __taskId ----> metricName ----> metirc -- This message was sent by Atlassian JIRA (v6.2#6252)