Github user revans2 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2203#discussion_r128591352
  
    --- Diff: storm-core/src/jvm/org/apache/storm/task/TopologyContext.java ---
    @@ -386,4 +388,28 @@ public ReducedMetric registerMetric(String name, 
IReducer reducer, int timeBucke
         public CombinedMetric registerMetric(String name, ICombiner combiner, 
int timeBucketSizeInSecs) {
             return registerMetric(name, new CombinedMetric(combiner), 
timeBucketSizeInSecs);
         }
    +
    +    public Timer registerTimer(String name){
    +        return StormMetricRegistry.registtry().timer(metricName(name));
    +    }
    +
    +    public Histogram registerHistogram(String name){
    +        return StormMetricRegistry.registtry().histogram(metricName(name));
    +    }
    +
    +    public Meter registerMeter(String name){
    +        return StormMetricRegistry.registtry().meter(metricName(name));
    +    }
    +
    +    public Counter registerCounter(String name){
    +        return StormMetricRegistry.registtry().counter(metricName(name));
    +    }
    +
    +    public Gauge registerGauge(String name, Gauge gauge){
    +        return StormMetricRegistry.registtry().register(metricName(name), 
gauge);
    +    }
    +
    +    private String metricName(String name){
    +        return String.format("storm.topology.%s.%s.%s-%s", getStormId(), 
getThisComponentId(), getThisWorkerPort(), name);
    --- End diff --
    
    Naming of metrics appears to be spread out all over the palace.  It would 
be nice to have it in a single place and have a way to parse things back out of 
it too.


---
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 infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to