flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject [3/3] flink git commit: [FLINK-2966][web-dashboard] Improve the way job duration is reported
Date Tue, 10 Nov 2015 14:15:11 GMT
[FLINK-2966][web-dashboard] Improve the way job duration is reported

This closes #1327.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/d7da7d4a
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/d7da7d4a
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/d7da7d4a

Branch: refs/heads/master
Commit: d7da7d4aa02bd6451d36968f1cabfd781c43de9c
Parents: e058abb
Author: Sachin Goel <sachingoel0101@gmail.com>
Authored: Wed Nov 4 20:34:48 2015 +0530
Committer: Maximilian Michels <mxm@apache.org>
Committed: Tue Nov 10 15:14:07 2015 +0100

----------------------------------------------------------------------
 .../app/partials/jobs/completed-jobs.jade       |  2 +-
 .../web-dashboard/app/partials/jobs/job.jade    |  4 +-
 .../jobs/job.plan.node-list.overview.jade       |  2 +-
 .../partials/jobs/job.plan.node.subtasks.jade   |  2 +-
 .../app/partials/jobs/running-jobs.jade         |  2 +-
 .../web-dashboard/app/partials/overview.jade    |  4 +-
 .../app/scripts/common/filters.coffee           | 26 +++++++++++
 flink-runtime-web/web-dashboard/web/js/index.js | 45 +++++++++++++++++++-
 .../web/partials/jobs/completed-jobs.html       |  2 +-
 .../web-dashboard/web/partials/jobs/job.html    |  2 +-
 .../jobs/job.plan.node-list.overview.html       |  2 +-
 .../partials/jobs/job.plan.node.subtasks.html   |  2 +-
 .../web/partials/jobs/running-jobs.html         |  2 +-
 .../web-dashboard/web/partials/overview.html    |  4 +-
 14 files changed, 84 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/d7da7d4a/flink-runtime-web/web-dashboard/app/partials/jobs/completed-jobs.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/completed-jobs.jade b/flink-runtime-web/web-dashboard/app/partials/jobs/completed-jobs.jade
index c16401d..06bc55f 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/completed-jobs.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/completed-jobs.jade
@@ -38,7 +38,7 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
       tr(ng-repeat="job in jobs|orderBy:\"'end-time'\":true" ui-sref="single-job.plan.overview({
jobid: job.jid })")
         td {{job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
         td {{job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
-        td {{job.duration}} ms
+        td(title="{{job.duration | humanizeDuration:false}}") {{job.duration | humanizeDuration:true}}
         td {{job.name}}
         td {{job.jid}}
         td.label-group

http://git-wip-us.apache.org/repos/asf/flink/blob/d7da7d4a/flink-runtime-web/web-dashboard/app/partials/jobs/job.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/job.jade b/flink-runtime-web/web-dashboard/app/partials/jobs/job.jade
index 61d1b17..7ec97bd 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/job.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/job.jade
@@ -36,8 +36,8 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main(ng-if="job")
       | - 
       | {{ job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss' }}
 
-  .navbar-info.last.first(ng-if="job.duration > -1")
-    | {{job.duration}} ms
+  .navbar-info.last.first(ng-if="job.duration > -1" title="{{job.duration | humanizeDuration:false}}")
+    | {{job.duration | humanizeDuration:true}}
 
   .navbar-info.last.first(ng-if="job.state=='RUNNING' || job.state=='CREATED'")
     span.navbar-info-button.btn.btn-default(ng-click="cancelJob($event)")

http://git-wip-us.apache.org/repos/asf/flink/blob/d7da7d4a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.overview.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.overview.jade
b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.overview.jade
index d0cdb3d..54bd29c 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.overview.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node-list.overview.jade
@@ -36,7 +36,7 @@ table.table.table-body-hover.table-clickable.table-activable
       td
         span(ng-if="v['end-time'] > -1") {{ v['end-time'] | amDateFormat:'YYYY-MM-DD,
H:mm:ss' }}
       td
-        span(ng-if="v.duration > -1") {{ v.duration }} ms
+        span(ng-if="v.duration > -1" title="{{v.duration | humanizeDuration:false}}")
{{v.duration | humanizeDuration:true}}
 
       td.td-long {{ v.name | humanizeText }}
       td {{ v.metrics['read-bytes'] | number }}

http://git-wip-us.apache.org/repos/asf/flink/blob/d7da7d4a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.subtasks.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.subtasks.jade
b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.subtasks.jade
index 96d9280..6350325 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.subtasks.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.subtasks.jade
@@ -40,7 +40,7 @@ table.table.table-hover.table-clickable.table-activable.table-inner(ng-if="subta
       td
         span(ng-if="subtask['end-time'] > -1") {{ subtask['end-time'] | amDateFormat:'YYYY-MM-DD,
H:mm:ss' }}
       td
-        span(ng-if="subtask.duration > -1") {{ subtask.duration }} ms
+        span(ng-if="subtask.duration > -1" title="{{subtask.duration | humanizeDuration:false}}")
{{subtask.duration | humanizeDuration:true}}
 
       td
         span(ng-if="subtask.metrics['read-bytes'] > -1") {{ subtask.metrics['read-bytes']
| number }}

http://git-wip-us.apache.org/repos/asf/flink/blob/d7da7d4a/flink-runtime-web/web-dashboard/app/partials/jobs/running-jobs.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/running-jobs.jade b/flink-runtime-web/web-dashboard/app/partials/jobs/running-jobs.jade
index 357f159..9eaa3b8 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/running-jobs.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/running-jobs.jade
@@ -38,7 +38,7 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
       tr(ng-repeat="job in jobs|orderBy:\"'start-time'\"" ui-sref="single-job.plan.overview({
jobid: job.jid })")
         td {{job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
         td {{job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
-        td {{job.duration}} ms
+        td(title="{{job.duration | humanizeDuration:false}}") {{job.duration | humanizeDuration:true}}
         td {{job.name}}
         td {{job.jid}}
         td.label-group

http://git-wip-us.apache.org/repos/asf/flink/blob/d7da7d4a/flink-runtime-web/web-dashboard/app/partials/overview.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/overview.jade b/flink-runtime-web/web-dashboard/app/partials/overview.jade
index 0b478d0..dbaf1a7 100644
--- a/flink-runtime-web/web-dashboard/app/partials/overview.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/overview.jade
@@ -98,7 +98,7 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
           tr(ng-repeat="job in runningJobs|orderBy:\"'start-time'\"" ui-sref="single-job.plan.overview({
jobid: job.jid })")
             td {{job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
             td {{job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
-            td {{job.duration}} ms
+            td(title="{{job.duration | humanizeDuration:false}}") {{job.duration | humanizeDuration:true}}
             td {{job.name}}
             td {{job.jid}}
             td.label-group
@@ -126,7 +126,7 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
           tr(ng-repeat="job in finishedJobs|orderBy:\"'end-time'\":true" ui-sref="single-job.plan.overview({
jobid: job.jid })")
             td {{job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
             td {{job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
-            td {{job.duration}} ms
+            td(title="{{job.duration | humanizeDuration:false}}") {{job.duration | humanizeDuration:true}}
             td {{job.name}}
             td {{job.jid}}
             td.label-group

http://git-wip-us.apache.org/repos/asf/flink/blob/d7da7d4a/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee b/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee
index e8e655a..a558a68 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee
@@ -28,6 +28,32 @@ angular.module('flinkApp')
 
   amDurationFormatExtendedFilter
 
+.filter "humanizeDuration", ->
+  (value, short) ->
+    return "" if typeof value is "undefined" or value is null
+    ms = value % 1000
+    x = Math.floor(value / 1000)
+    seconds = x % 60
+    x = Math.floor(x / 60)
+    minutes = x % 60
+    x = Math.floor(x / 60)
+    hours = x % 24
+    x = Math.floor(x / 24)
+    days = x
+    if days == 0
+      if hours == 0
+        if minutes == 0
+          if seconds == 0
+            return ms + "ms"
+          else
+            return seconds + "s "
+        else
+          return minutes + "m " + seconds + "s"
+      else
+        if short then return hours + "h " + minutes + "m" else return hours + "h " + minutes
+ "m " + seconds + "s"
+    else
+      if short then return days + "d " + hours + "h" else return days + "d " + hours + "h
" + minutes + "m " + seconds + "s"
+
 .filter "humanizeText", ->
   (text) ->
     # TODO: extend... a lot


Mime
View raw message