This is an automated email from the ASF dual-hosted git repository.

jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new f14700a1e2 only emit throttling metrics when throttling is allowed 
(#11443)
f14700a1e2 is described below

commit f14700a1e2d7ba463ef1c4afb0d7ef2366e1c4f3
Author: Johan Adami <[email protected]>
AuthorDate: Wed Aug 30 16:59:34 2023 -0400

    only emit throttling metrics when throttling is allowed (#11443)
---
 .../data/manager/realtime/RealtimeConsumptionRateManager.java | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
index f2bb60ce81..bc5d16e915 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeConsumptionRateManager.java
@@ -147,9 +147,14 @@ public class RealtimeConsumptionRateManager {
 
     @Override
     public void throttle(int numMsgs) {
-      _metricEmitter.emitMetric(numMsgs, _rate, Clock.systemUTC().instant());
-      if (InstanceHolder.INSTANCE._isThrottlingAllowed && numMsgs > 0) {
-        _rateLimiter.acquire(numMsgs);
+      if (InstanceHolder.INSTANCE._isThrottlingAllowed) {
+        // Only emit metrics when throttling is allowed. Throttling is not 
enabled.
+        // until the server has passed startup checks. Otherwise, we will see
+        // consumption well over 100% during startup.
+        _metricEmitter.emitMetric(numMsgs, _rate, Clock.systemUTC().instant());
+        if (numMsgs > 0) {
+          _rateLimiter.acquire(numMsgs);
+        }
       }
     }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to