Uploaded image for project: 'Apache Storm'
  1. Apache Storm
  2. STORM-254

one Spout/Bolt can register metric twice with same name

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.2-incubating
    • Fix Version/s: 0.9.3
    • Component/s: storm-core
    • Labels:
      None

      Description

      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

        Attachments

          Activity

            People

            • Assignee:
              dashengju DashengJu
              Reporter:
              dashengju DashengJu
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 12h
                12h
                Remaining:
                Remaining Estimate - 12h
                12h
                Logged:
                Time Spent - Not Specified
                Not Specified