This is an automated email from the ASF dual-hosted git repository. jlli pushed a commit to branch hotfix-0.2.645 in repository https://gitbox.apache.org/repos/asf/incubator-pinot.git
commit dd4086e5fb614eb1841e710550d5282911eb8338 Author: Xiaoman Dong <[email protected]> AuthorDate: Thu Apr 1 00:01:31 2021 -0700 Fix broken timer properly (#6734) * Fix broken timer properly * Fix broken build The missing import somehow got slipped in git diff --- .../java/org/apache/pinot/common/metrics/AbstractMetrics.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pinot-common/src/main/java/org/apache/pinot/common/metrics/AbstractMetrics.java b/pinot-common/src/main/java/org/apache/pinot/common/metrics/AbstractMetrics.java index f8f0967..44a53c0 100644 --- a/pinot-common/src/main/java/org/apache/pinot/common/metrics/AbstractMetrics.java +++ b/pinot-common/src/main/java/org/apache/pinot/common/metrics/AbstractMetrics.java @@ -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,8 +151,11 @@ 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); + } + } /** * Logs a value to a meter. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
