sunithabeeram commented on a change in pull request #3913: Adding the support 
for sampling logs
URL: https://github.com/apache/incubator-pinot/pull/3913#discussion_r263491718
 
 

 ##########
 File path: 
pinot-core/src/main/java/org/apache/pinot/core/query/scheduler/QueryScheduler.java
 ##########
 @@ -170,13 +181,16 @@ public void stop() {
 
     TimerContext timerContext = queryRequest.getTimerContext();
     int numSegmentsQueried = queryRequest.getSegmentsToQuery().size();
-    LOGGER.info(
-        "Processed 
requestId={},table={},segments(queried/processed/matched)={}/{}/{},schedulerWaitMs={},totalExecMs={},totalTimeMs={},broker={},numDocsScanned={},scanInFilter={},scanPostFilter={},sched={}",
-        requestId, tableNameWithType, numSegmentsQueried, 
numSegmentsProcessed, numSegmentsMatched,
-        timerContext.getPhaseDurationMs(ServerQueryPhase.SCHEDULER_WAIT),
-        timerContext.getPhaseDurationMs(ServerQueryPhase.QUERY_PROCESSING),
-        timerContext.getPhaseDurationMs(ServerQueryPhase.TOTAL_QUERY_TIME), 
queryRequest.getBrokerId(), numDocsScanned,
-        numEntriesScannedInFilter, numEntriesScannedPostFilter, name());
+    long schedulerWaitMs = 
timerContext.getPhaseDurationMs(ServerQueryPhase.SCHEDULER_WAIT);
+
+    if (queryLogRateLimiter.tryAcquire() || forceLog(schedulerWaitMs, 
numDocsScanned)) {
+      LOGGER.info(
+          "Processed 
requestId={},table={},segments(queried/processed/matched)={}/{}/{},schedulerWaitMs={},totalExecMs={},totalTimeMs={},broker={},numDocsScanned={},scanInFilter={},scanPostFilter={},sched={}",
+          requestId, tableNameWithType, numSegmentsQueried, 
numSegmentsProcessed, numSegmentsMatched, schedulerWaitMs,
+          timerContext.getPhaseDurationMs(ServerQueryPhase.QUERY_PROCESSING),
+          timerContext.getPhaseDurationMs(ServerQueryPhase.TOTAL_QUERY_TIME), 
queryRequest.getBrokerId(),
+          numDocsScanned, numEntriesScannedInFilter, 
numEntriesScannedPostFilter, name());
 
 Review comment:
   +1

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to