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 2b4036292e [logging] fix consume rate logging bug to respect 1 minute 
threshold (#11421)
2b4036292e is described below

commit 2b4036292e68f97b0720583e04f3941644d4ec89
Author: Johan Adami <[email protected]>
AuthorDate: Fri Aug 25 13:46:35 2023 -0400

    [logging] fix consume rate logging bug to respect 1 minute threshold 
(#11421)
---
 .../core/data/manager/realtime/LLRealtimeSegmentDataManager.java   | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
index 4acab57731..c1df3e5f65 100644
--- 
a/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
+++ 
b/pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java
@@ -1648,14 +1648,15 @@ public class LLRealtimeSegmentDataManager extends 
RealtimeSegmentDataManager {
     _lastUpdatedRowsIndexed.set(_numRowsIndexed);
     final long now = now();
     final int rowsConsumed = _numRowsConsumed - _lastConsumedCount;
-    final long prevTime = _lastConsumedCount == 0 ? _consumeStartTime : 
_lastLogTime;
+    final long prevTime = _lastLogTime == 0 ? _consumeStartTime : _lastLogTime;
     // Log every minute or 100k events
     if (now - prevTime > 
TimeUnit.MINUTES.toMillis(TIME_THRESHOLD_FOR_LOG_MINUTES)
         || rowsConsumed >= MSG_COUNT_THRESHOLD_FOR_LOG) {
+      // multiply by 1000 to get events/sec. now and prevTime are in 
milliseconds.
+      float consumedRate = ((float) rowsConsumed) * 1000 / (now - prevTime);
       _segmentLogger.info(
           "Consumed {} events from (rate:{}/s), currentOffset={}, 
numRowsConsumedSoFar={}, numRowsIndexedSoFar={}",
-          rowsConsumed, (float) (rowsConsumed) * 1000 / (now - prevTime), 
_currentOffset, _numRowsConsumed,
-          _numRowsIndexed);
+          rowsConsumed, consumedRate, _currentOffset, _numRowsConsumed, 
_numRowsIndexed);
       _lastConsumedCount = _numRowsConsumed;
       _lastLogTime = now;
     }


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

Reply via email to