kfaraz commented on code in PR #16314:
URL: https://github.com/apache/druid/pull/16314#discussion_r1572728528


##########
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/autoscaler/LagBasedAutoScaler.java:
##########
@@ -155,13 +154,7 @@ private Runnable computeAndCollectLag()
       LOCK.lock();
       try {
         if (!spec.isSuspended()) {
-          LagStats lagStats = supervisor.computeLagStats();
-          if (lagStats == null) {
-            lagMetricsQueue.offer(0L);
-          } else {
-            long lag = lagStats.get(supervisor.getLagMetricForAutoScaler());
-            lagMetricsQueue.offer(lag > 0 ? lag : 0L);
-          }
+          lagMetricsQueue.offer(supervisor.computeLagForAutoScaler());

Review Comment:
   I think we still need to handle the case where the returned lag is negative.
   
   ```suggestion
             long lag = supervisor.computeLagForAutoScaler();
             lagMetricsQueue.offer(lag > 0 ? lag : 0L);
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to