[ARVADOS] updated: 5ee5b90b5d7554d049c9071ed7bb812d1b7ca74a

git at public.curoverse.com git at public.curoverse.com
Mon Sep 22 13:10:08 EDT 2014


Summary of changes:
 .../app/views/application/_job_progress.html.erb          | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

       via  5ee5b90b5d7554d049c9071ed7bb812d1b7ca74a (commit)
      from  b96a5d949f88fa4f11570ffdf3b951602a3ea4aa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 5ee5b90b5d7554d049c9071ed7bb812d1b7ca74a
Author: radhika <radhika at curoverse.com>
Date:   Mon Sep 22 13:09:02 2014 -0400

    3381: address the situation where sum percentages calculated exceeded 100%

diff --git a/apps/workbench/app/views/application/_job_progress.html.erb b/apps/workbench/app/views/application/_job_progress.html.erb
index 5c19779..f942c44 100644
--- a/apps/workbench/app/views/application/_job_progress.html.erb
+++ b/apps/workbench/app/views/application/_job_progress.html.erb
@@ -24,6 +24,21 @@
      failed_percent = (failed * percent_total_tasks).ceil
      success_percent = (done * percent_total_tasks).ceil
      running_percent = (running * percent_total_tasks).ceil
+
+     # We used ceil instead of round to compute percents to handle the situation
+     # where one of them is much larger than the other(s). However, this may
+     # have resulted in total percent > 100, hence we need to account for that.
+     if (failed_percent + success_percent + running_percent) > 100
+        overflow = failed_percent + success_percent + running_percent - 100
+        # decrease the biggest by the overlow amount
+        if (failed_percent > success_percent) && (failed_percent > running_percent)
+          failed_percent -= overflow
+        elsif (success_percent > failed_percent) && (success_percent > running_percent)
+          success_percent -= overflow
+        else
+          running_percent -= overflow
+        end
+     end
    end
 %>
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list