zhangyue19921010 commented on a change in pull request #10524:
URL: https://github.com/apache/druid/pull/10524#discussion_r531686905



##########
File path: 
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/supervisor/SeekableStreamSupervisor.java
##########
@@ -791,6 +1016,38 @@ public void tryInit()
     }
   }
 
+  private Runnable collectAndcollectLags()
+  {
+    return new Runnable() {
+      @Override
+      public void run()
+      {
+        lock.lock();
+        try {
+          if (!spec.isSuspended()) {
+            ArrayList<Long> metricsInfo = new ArrayList<>(3);
+            collectLag(metricsInfo);
+            long totalLags = metricsInfo.size() < 3 ? 0 : metricsInfo.get(1);
+            queue.offer(totalLags > 0 ? totalLags : 0);
+            log.info("Current lag metric points : " + new ArrayList<>(queue));
+          } else {
+            log.info("[%s] supervisor is suspended, skip to collect kafka 
lags", dataSource);
+          }
+        }
+        catch (Exception e) {
+          log.error(e, "Error, When collect kafka lags");

Review comment:
       Done.




----------------------------------------------------------------
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]



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

Reply via email to