pnowojski commented on a change in pull request #14618:
URL: https://github.com/apache/flink/pull/14618#discussion_r555807692



##########
File path: 
flink-runtime-web/web-dashboard/src/app/pages/job/overview/backpressure/job-overview-drawer-backpressure.component.ts
##########
@@ -41,6 +41,15 @@ export class JobOverviewDrawerBackpressureComponent 
implements OnInit, OnDestroy
     return node.subtask;
   }
 
+  prettyPrint(value: number): string {
+    if (isNaN(value)) {
+      return "N/A"
+    }
+    else {
+      return Math.round(value * 100) + "%";

Review comment:
       Ok, I get your point. I have two reasons why I decided to round it:
   
   - it takes less space in the WebUI, and it's currently being displayed in 
one column, three ratios (back pressured / idle / busy) one after another. For 
example: `14% / 36% / 50%`. Adding decimal places was clogging this view a bit.
   - those metrics are already approximations. For example sleeping intervals 
of <1ms are not measured accurately, but only asymptomatically. If you measure 
many intervals intervals,  this +/-1ms will average out. So even if report 
`100.0%` without this `Math.round()` call, it still doesn't necessarily mean 
usage was 100%. But 100% +/- 1ms asymptomatically. And in the worst case 
scenario (with every sleep interval being 0.499ms and measured as 0ms) we can 
have reported 0.0% usage, while in reality it should have been 49.9% (this 
worst case scenario is unrealistic though)
   - floats/doubles are not precise anyway 




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