JonathanKessler commented on a change in pull request #4780:
URL: https://github.com/apache/nifi/pull/4780#discussion_r582152524
##########
File path:
nifi-framework-api/src/main/java/org/apache/nifi/controller/queue/FlowFileQueue.java
##########
@@ -93,6 +93,18 @@
QueueSize size();
+ /**
+ * @param fromTimestamp The timestamp in milliseconds from which to
calculate durations. This will typically be the current timestamp.
+ * @return the sum in milliseconds of how long all FlowFiles within this
queue have currently been in this queue.
+ */
+ long getTotalActiveQueuedDuration(long fromTimestamp);
+
+ /**
+ * @param fromTimestamp The timestamp in milliseconds from which to
calculate durations. This will typically be the current timestamp.
+ * @return the maximum time in milliseconds that any FlowFile within this
queue has been in this queue.
+ */
+ long getMaxActiveQueuedDuration(long fromTimestamp);
Review comment:
It is definitely more efficient to return the timestamp and do one
calculation vs calculating the difference for every flow file prior to
returning a max. 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:
[email protected]