You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@gobblin.apache.org by GitBox <gi...@apache.org> on 2019/06/11 18:26:56 UTC

[GitHub] [incubator-gobblin] jack-moseley commented on a change in pull request #2668: [GOBBLIN-802] change gauge metrics context to RootMetricsContext

jack-moseley commented on a change in pull request #2668: [GOBBLIN-802] change gauge metrics context to RootMetricsContext
URL: https://github.com/apache/incubator-gobblin/pull/2668#discussion_r292599568
 
 

 ##########
 File path: gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/MetricContext.java
 ##########
 @@ -515,7 +515,9 @@ public ContextAwareTimer contextAwareTimer(String name, long windowSize, TimeUni
    * @return a new {@link ContextAwareGauge}
    */
   public <T> ContextAwareGauge<T> newContextAwareGauge(String name, Gauge<T> gauge) {
-    return new ContextAwareGauge<T>(this, name, gauge);
+    ContextAwareGauge<T> newContextAwareGauge = new ContextAwareGauge<>(innerMetricContext.getMetricContext().get(), name, gauge);
+    this.innerMetricContext.register(name, newContextAwareGauge);
 
 Review comment:
   Maybe use the `MetricContext.register` method instead.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services