You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2021/02/24 17:22:57 UTC

[GitHub] [nifi] JonathanKessler commented on a change in pull request #4780: NIFI-8126 Include Total Queued Duration in ConnectionStatus metrics

JonathanKessler commented on a change in pull request #4780:
URL: https://github.com/apache/nifi/pull/4780#discussion_r582151894



##########
File path: nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/queue/SwappablePriorityQueue.java
##########
@@ -920,7 +921,14 @@ public SwapSummary recoverSwappedFlowFiles() {
         return new StandardSwapSummary(new QueueSize(swapFlowFileCount, swapByteCount), maxId, resourceClaims);
     }
 
+    public long getMaxActiveQueuedDuration(long fromTimestamp) {
+        // We want the oldest timestamp, which will be the min
+        return fromTimestamp - activeQueue.parallelStream().map(FlowFile::getLastQueueDate).filter(Objects::nonNull).min(Long::compareTo).orElse(fromTimestamp);

Review comment:
       Understood and agreed. I will update accordingly.




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