mcvsubbu commented on a change in pull request #6887:
URL: https://github.com/apache/incubator-pinot/pull/6887#discussion_r628489699



##########
File path: 
pinot-common/src/main/java/org/apache/pinot/common/metrics/AbstractMetrics.java
##########
@@ -462,16 +463,48 @@ public void addCallbackGaugeIfNeeded(final String 
metricName, final Callable<Lon
    * @param valueCallback The callback function used to retrieve the value of 
the gauge
    */
   public void addCallbackGauge(final String metricName, final Callable<Long> 
valueCallback) {
-    PinotMetricUtils.makeGauge(_metricsRegistry, 
PinotMetricUtils.makePinotMetricName(_clazz, _metricPrefix + metricName),
-        PinotMetricUtils.makePinotGauge(avoid -> {
-          try {
-            return valueCallback.call();
-          } catch (Exception e) {
-            LOGGER.error("Caught exception", e);
-            Utils.rethrowException(e);
-            throw new AssertionError("Should not reach this");
-          }
-        }));
+    PinotMetricUtils
+        .makeGauge(_metricsRegistry, 
PinotMetricUtils.makePinotMetricName(_clazz, _metricPrefix + metricName),
+            PinotMetricUtils.makePinotGauge(avoid -> {
+              try {
+                return valueCallback.call();
+              } catch (Exception e) {
+                LOGGER.error("Caught exception", e);
+                Utils.rethrowException(e);
+                throw new AssertionError("Should not reach this");

Review comment:
       I assume this was added when testing Utils.rethrowException(). Do we 
need this assertion here?




-- 
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to