diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/questdb/QuestDbQueries.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/questdb/QuestDbQueries.java index a773a2e59d..14986012b0 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/questdb/QuestDbQueries.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/questdb/QuestDbQueries.java @@ -86,7 +86,10 @@ final class QuestDbQueries { "outputBytes LONG," + "outputCount LONG," + "queuedBytes LONG," + - "queuedCount LONG" + + "queuedCount LONG," + + "totalQueuedDuration LONG," + + "maxQueuedDuration LONG," + + "averageQueuedDuration LONG" + ") TIMESTAMP(capturedAt) PARTITION BY DAY"; public static final String CREATE_PROCESS_GROUP_STATUS = diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/storage/questdb/QuestDbConnectionStatusStorage.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/storage/questdb/QuestDbConnectionStatusStorage.java index 8755bbca05..fcc565547d 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/storage/questdb/QuestDbConnectionStatusStorage.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/storage/questdb/QuestDbConnectionStatusStorage.java @@ -35,6 +35,9 @@ public class QuestDbConnectionStatusStorage extends QuestDbComponentStatusStorag METRICS.put(5, ConnectionStatusDescriptor.OUTPUT_COUNT.getDescriptor()); METRICS.put(6, ConnectionStatusDescriptor.QUEUED_BYTES.getDescriptor()); METRICS.put(7, ConnectionStatusDescriptor.QUEUED_COUNT.getDescriptor()); + METRICS.put(8, ConnectionStatusDescriptor.TOTAL_QUEUED_DURATION.getDescriptor()); + METRICS.put(9, ConnectionStatusDescriptor.MAX_QUEUED_DURATION.getDescriptor()); + METRICS.put(10, ConnectionStatusDescriptor.AVERAGE_QUEUED_DURATION.getDescriptor()); } public QuestDbConnectionStatusStorage(final QuestDbContext dbContext, final ComponentDetailsStorage componentDetails) { diff --git a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/status/history/AbstractStatusHistoryRepositoryTest.java b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/status/history/AbstractStatusHistoryRepositoryTest.java index b80d7c0e66..6288080e85 100644 --- a/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/status/history/AbstractStatusHistoryRepositoryTest.java +++ b/nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/status/history/AbstractStatusHistoryRepositoryTest.java @@ -161,6 +161,10 @@ public abstract class AbstractStatusHistoryRepositoryTest { status.setOutputBytes(106); status.setMaxQueuedCount(107); status.setMaxQueuedBytes(108); + + status.setTotalQueuedDuration(103L * 110L); + status.setMaxQueuedDuration(111); + return status; } @@ -261,6 +265,10 @@ public abstract class AbstractStatusHistoryRepositoryTest { Assert.assertEquals(105L, snapshot.getStatusMetric(ConnectionStatusDescriptor.OUTPUT_COUNT.getDescriptor()).longValue()); Assert.assertEquals(104L, snapshot.getStatusMetric(ConnectionStatusDescriptor.QUEUED_BYTES.getDescriptor()).longValue()); Assert.assertEquals(103L, snapshot.getStatusMetric(ConnectionStatusDescriptor.QUEUED_COUNT.getDescriptor()).longValue()); + + Assert.assertEquals(103L * 110L, snapshot.getStatusMetric(ConnectionStatusDescriptor.TOTAL_QUEUED_DURATION.getDescriptor()).longValue()); + Assert.assertEquals(111L, snapshot.getStatusMetric(ConnectionStatusDescriptor.MAX_QUEUED_DURATION.getDescriptor()).longValue()); + Assert.assertEquals(110L, snapshot.getStatusMetric(ConnectionStatusDescriptor.AVERAGE_QUEUED_DURATION.getDescriptor()).longValue()); } protected void assertRemoteProcessGroupSnapshot(final StatusSnapshot snapshot) {