You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pinot.apache.org by "jadami10 (via GitHub)" <gi...@apache.org> on 2023/08/24 23:10:46 UTC
[GitHub] [pinot] jadami10 commented on a diff in pull request #11421: [logging] fix consume rate logging bug to respect 1 minute threshold
jadami10 commented on code in PR #11421:
URL: https://github.com/apache/pinot/pull/11421#discussion_r1304955886
##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/LLRealtimeSegmentDataManager.java:
##########
@@ -1648,12 +1648,13 @@ private void updateCurrentDocumentCountMetrics() {
_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) {
_segmentLogger.info(
"Consumed {} events from (rate:{}/s), currentOffset={}, numRowsConsumedSoFar={}, numRowsIndexedSoFar={}",
+ // multiply by 1000 to get events/sec. now and prevTime are in milliseconds.
rowsConsumed, (float) (rowsConsumed) * 1000 / (now - prevTime), _currentOffset, _numRowsConsumed,
Review Comment:
I changed it your suggestion but also pulled it out into a separate var. I did test before and after with RealtimeQuickstart, and it did seem to be logging correctly before as well. But I figure clearer casting can't hurt
--
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.
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@pinot.apache.org
For additional commands, e-mail: commits-help@pinot.apache.org