jon-wei commented on a change in pull request #9509: add kinesis lag metric
URL: https://github.com/apache/druid/pull/9509#discussion_r393412399
 
 

 ##########
 File path: 
extensions-core/kinesis-indexing-service/src/main/java/org/apache/druid/indexing/kinesis/KinesisRecordSupplier.java
 ##########
 @@ -148,6 +149,53 @@ void stopBackgroundFetch()
       stopRequested = true;
     }
 
+    long getPartitionTimeLag()
+    {
+      return currentLagMillis;
+    }
+
+    long getPartitionTimeLag(String offset)
+    {
+      // if not started (fetching records in background), fetch lag ourself 
with a throw-away iterator
+      if (!started) {
+        try {
+          final String iteratorType;
+          final String offsetToUse;
+          if (offset == null || KinesisSupervisor.NOT_SET.equals(offset)) {
+            // this should probably check if will start processing earliest or 
latest rather than assuming earliest
+            // if latest we could skip this because latest will not be behing 
latest so lag is 0.
 
 Review comment:
   behing -> behind

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@druid.apache.org
For additional commands, e-mail: commits-h...@druid.apache.org

Reply via email to