Fix broken timer properly
* Fix broken timer properly
* Fix broken build
The missing import somehow got slipped in git diff
@@ -33,6 +33,7 @@ import org.apache.pinot.common.Utils;
import org.apache.pinot.spi.metrics.PinotMeter;
import org.apache.pinot.spi.metrics.PinotMetricName;
import org.apache.pinot.spi.metrics.PinotMetricsRegistry;
+import org.apache.pinot.spi.metrics.PinotTimer;
import org.apache.pinot.spi.utils.builder.TableNameBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -150,7 +151,10 @@ public abstract class AbstractMetrics<QP extends AbstractMetrics.QueryPhase, M e
*/
private void addValueToTimer(String fullTimerName, final long duration, final TimeUnit timeUnit) {
final PinotMetricName metricName = PinotMetricUtils.makePinotMetricName(_clazz, fullTimerName);
- PinotMetricUtils.makePinotTimer(_metricsRegistry, metricName, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
+ PinotTimer timer = PinotMetricUtils.makePinotTimer(_metricsRegistry, metricName, TimeUnit.MILLISECONDS, TimeUnit.SECONDS);
+ if (timer != null) {
+ timer.update(duration, timeUnit);
+ }
}
/**
