You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2020/03/17 02:40:25 UTC

[GitHub] [druid] jon-wei commented on a change in pull request #9509: add kinesis lag metric

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


With regards,
Apache Git Services

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