You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2018/12/11 14:19:42 UTC

[GitHub] oferze commented on a change in pull request #4304: [AIRFLOW-3500] Make task duration display user friendly

oferze commented on a change in pull request #4304: [AIRFLOW-3500] Make task duration display user friendly
URL: https://github.com/apache/incubator-airflow/pull/4304#discussion_r240627558
 
 

 ##########
 File path: airflow/www/templates/airflow/graph.html
 ##########
 @@ -282,13 +282,21 @@
               tt += "Operator: " + task.task_type + "<br>";
               tt += "Started: " + ti.start_date + "<br>";
               tt += "Ended: " + ti.end_date + "<br>";
-              tt += "Duration: " + ti.duration + "<br>";
+              tt += "Duration: " + secondsToString(ti.duration) + "<br>";
               tt += "State: " + ti.state + "<br>";
               return tt;
             });
         });
     }
 
+    function secondsToString(seconds) {
+        var numdays = Math.floor((seconds % 31536000) / 86400); 
 
 Review comment:
   Removing it would mean that one day someone will say "oh my task runs for days and it says 75 hours, I wish it would say the number of days". So I think better have it than not...

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services