NIFI-1921: Fixed bug in how average lineage duration was calculated for cluster stat

Signed-off-by: Matt Burgess <mattyb149@apache.org>

This closes #1912
This commit is contained in:
Mark Payne 2017-06-12 16:23:39 -04:00 committed by Matt Burgess
parent 2b47ade0c4
commit c0ad5bcc7b
1 changed files with 4 additions and 3 deletions

View File

@ -115,12 +115,13 @@ public enum ProcessorStatusDescriptor {
for (final StatusSnapshot snapshot : values) {
final long removed = snapshot.getStatusMetrics().get(FLOWFILES_REMOVED.getDescriptor()).longValue();
count += removed;
final long outputCount = snapshot.getStatusMetrics().get(OUTPUT_COUNT.getDescriptor()).longValue();
final long processed = removed + outputCount;
count += snapshot.getStatusMetrics().get(OUTPUT_COUNT.getDescriptor()).longValue();
count += processed;
final long avgMillis = snapshot.getStatusMetrics().get(AVERAGE_LINEAGE_DURATION.getDescriptor()).longValue();
final long totalMillis = avgMillis * removed;
final long totalMillis = avgMillis * processed;
millis += totalMillis;
}