simonbence commented on a change in pull request #4821:
URL: https://github.com/apache/nifi/pull/4821#discussion_r579133945



##########
File path: 
nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/main/java/org/apache/nifi/controller/status/history/ProcessGroupStatusDescriptor.java
##########
@@ -113,16 +113,16 @@ public String getField() {
 
 
     private static long calculateTaskMillis(final ProcessGroupStatus status) {
-        long nanos = 0L;

Review comment:
       I think I mentioned this at the PR description, but the point would be 
to avoid loss of information: with the original code, at every level of the 
recursion we did a nano > millis conversion, but the caller (one level up in 
the recursion) would consider the result as nano. Thus, the deeper we are in 
the group structure, the more times we make a conversion, which looks to be 
incorrect.
   
   If you still think that this comes with rounding errors, what I would 
suggest is to introduce a `calculateTaskNanos`, which would handle the 
recursion and work without converting, ant the `calculateTaskMillis` would call 
this and converting the end result only once.




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


Reply via email to