You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by se...@apache.org on 2015/09/17 20:19:44 UTC
[12/51] [abbrv] flink git commit: [FLINK-2357] [web dashboard]
Changed overview and timeline
[FLINK-2357] [web dashboard] Changed overview and timeline
Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/b29a5d44
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/b29a5d44
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/b29a5d44
Branch: refs/heads/master
Commit: b29a5d446b1b3b2cea5f0bd3230f854f3eecdd3c
Parents: 628e5f7
Author: Piotr Godek <pi...@gmail.com>
Authored: Thu Aug 20 17:06:57 2015 +0200
Committer: Stephan Ewen <se...@apache.org>
Committed: Thu Sep 17 14:21:50 2015 +0200
----------------------------------------------------------------------
.../runtime/webmonitor/WebRuntimeMonitor.java | 6 +-
.../app/partials/jobs/completed-jobs.jade | 8 +-
.../web-dashboard/app/partials/jobs/job.jade | 8 +-
.../app/partials/jobs/job.plan.node.jade | 4 +-
.../app/partials/jobs/job.timeline.vertex.jade | 2 +-
.../app/partials/jobs/running-jobs.jade | 8 +-
.../web-dashboard/app/partials/overview.jade | 32 +++---
.../app/scripts/common/filters.coffee | 5 +
.../app/scripts/common/services.coffee | 34 +++++++
.../web-dashboard/app/scripts/index.coffee | 17 ++--
.../app/scripts/modules/jobs/jobs.dir.coffee | 13 ++-
.../app/scripts/modules/jobs/jobs.svc.coffee | 20 ++--
.../modules/overview/overview.ctrl.coffee | 3 +
.../modules/overview/overview.svc.coffee | 18 ++--
.../web-dashboard/vendor-local/d3-timeline.js | 69 ++++++++-----
flink-runtime-web/web-dashboard/web/js/index.js | 101 ++++++++++++-------
.../web-dashboard/web/js/vendor.js | 71 ++++++++-----
.../web/partials/jobs/completed-jobs.html | 8 +-
.../web-dashboard/web/partials/jobs/job.html | 8 +-
.../web/partials/jobs/job.plan.node.html | 4 +-
.../web/partials/jobs/job.timeline.vertex.html | 2 +-
.../web/partials/jobs/running-jobs.html | 8 +-
.../web-dashboard/web/partials/overview.html | 32 +++---
23 files changed, 299 insertions(+), 182 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
----------------------------------------------------------------------
diff --git a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
index 85b2171..0799328 100644
--- a/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
+++ b/flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebRuntimeMonitor.java
@@ -128,14 +128,12 @@ public class WebRuntimeMonitor implements WebMonitor {
// the overview - how many task managers, slots, free slots, ...
.GET("/overview", handler(new RequestOverviewHandler(jobManager, DEFAULT_REQUEST_TIMEOUT)))
- // list of job ids for all jobs in each status
- .GET("/jobids", handler(new RequestJobIdsHandler(jobManager, DEFAULT_REQUEST_TIMEOUT)))
-
// overview over jobs
.GET("/joboverview", handler(new JobsOverviewHandler(jobManager, DEFAULT_REQUEST_TIMEOUT, true, true)))
- .GET("/joboverview/running",handler(new JobsOverviewHandler(jobManager, DEFAULT_REQUEST_TIMEOUT, true, false)))
+ .GET("/joboverview/running", handler(new JobsOverviewHandler(jobManager, DEFAULT_REQUEST_TIMEOUT, true, false)))
.GET("/joboverview/completed", handler(new JobsOverviewHandler(jobManager, DEFAULT_REQUEST_TIMEOUT, false, true)))
+ .GET("/jobs", handler(new RequestJobIdsHandler(jobManager, DEFAULT_REQUEST_TIMEOUT)))
.GET("/jobs/:jobid", handler(new JobSummaryHandler(currentGraphs)))
.GET("/jobs/:jobid/vertices", handler(new JobVerticesOverviewHandler(currentGraphs)))
.GET("/jobs/:jobid/plan", handler(new ExecutionPlanHandler(currentGraphs)))
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/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 a629730..1233a21 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
@@ -36,12 +36,12 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
tbody
tr(ng-repeat="job in jobs" ui-sref="single-job.plan({ jobid: job.jid })")
- td {{job['start-time']}}
- td {{job['end-time']}}
- td {{job.duration}}
+ td {{job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
+ td {{job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
+ td {{job['end-time'] - job['start-time']}} ms
td {{job.name}}
td {{job.jid}}
td.label-group
- bs-label(status="{{status}}" ng-repeat="(status, value) in job.operators") {{value}}
+ bs-label(status="{{status}}" ng-repeat="(status, value) in job.tasks") {{value}}
td
bs-label(status="{{job.state}}") {{job.state}}
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/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 2591aff..7fb3234 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/job.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/job.jade
@@ -28,15 +28,15 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main(ng-if="job")
.navbar-info.first.last
.label-group
- bs-label(status="{{status}}" ng-repeat="(status, value) in job.operators") {{value}}
+ bs-label(status="{{status}}" ng-repeat="(status, value) in job.tasks") {{value}}
.navbar-info.first.last.hidden-xs.hidden-sm
- | {{ job['start-time'] }}
+ | {{ job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss' }}
| -
- | {{ job['end-time'] }}
+ | {{ job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss' }}
.navbar-info.last.first
- | {{job.duration}}
+ | {{job['end-time'] - job['start-time']}} ms
nav.navbar.navbar-default.navbar-fixed-top.navbar-main-additional(ng-if="job")
ul.nav.nav-tabs
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.jade b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.jade
index 0ddd457..9ca30f1 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/job.plan.node.jade
@@ -29,7 +29,7 @@
.panel-heading.clearfix
.panel-info.first.last(ng-if="node.description")
- span {{ node.description }}
+ span {{ node.description | humanizeTaskName }}
.panel-body
table.table.table-hover.table-clickable
@@ -40,7 +40,7 @@
tbody
tr(ng-repeat="vertex in node.vertex.groupvertex.groupmembers")
- td {{vertex.vertexname}}
+ td {{ vertex.vertexname | humanizeTaskName }}
td
bs-label(status="{{vertex.vertexstatus}}") {{vertex.vertexstatus}}
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/partials/jobs/job.timeline.vertex.jade
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/partials/jobs/job.timeline.vertex.jade b/flink-runtime-web/web-dashboard/app/partials/jobs/job.timeline.vertex.jade
index e90bf56..5c912f3 100644
--- a/flink-runtime-web/web-dashboard/app/partials/jobs/job.timeline.vertex.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/jobs/job.timeline.vertex.jade
@@ -18,7 +18,7 @@
.panel.panel-default.panel-multi(ng-if="vertex")
.panel-heading.clearfix
.panel-title
- | {{ vertex.groupvertex.groupvertexname }}
+ | {{ vertex.groupvertex.groupvertexname | humanizeTaskName }}
//- .panel-info.first
//- | Vertex ID: {{ vertex.groupvertex.groupvertexid }}
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/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 e606508..d76d9af 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
@@ -36,12 +36,12 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
tbody
tr(ng-repeat="job in jobs" ui-sref="single-job.plan({ jobid: job.jid })")
- td {{job['start-time']}}
- td {{job['end-time']}}
- td {{job.duration}}
+ td {{job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
+ td {{job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
+ td {{job['end-time'] - job['start-time']}} ms
td {{job.name}}
td {{job.jid}}
td.label-group
- bs-label(status="{{status}}" ng-repeat="(status, value) in job.operators") {{value}}
+ bs-label(status="{{status}}" ng-repeat="(status, value) in job.tasks") {{value}}
td
bs-label(status="{{job.state}}") {{job.state}}
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/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 e8b1f65..aa92ac0 100644
--- a/flink-runtime-web/web-dashboard/app/partials/overview.jade
+++ b/flink-runtime-web/web-dashboard/app/partials/overview.jade
@@ -31,7 +31,7 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
.col-xs-3
i.fa.fa-tasks.fa-3x
.col-xs-9.text-right
- .huge 3
+ .huge {{overview.taskmanagers}}
div Task Managers
.panel-heading
@@ -39,7 +39,7 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
.col-xs-3
i.fa.fa-folder.fa-3x
.col-xs-9.text-right
- .huge 5
+ .huge {{overview["slots-total"]}}
div Task Slots
.panel-heading
@@ -47,7 +47,7 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
.col-xs-3
i.fa.fa-folder-o.fa-3x
.col-xs-9.text-right
- .huge 2
+ .huge {{overview["slots-available"]}}
div Available Task Slots
.col-md-6
@@ -56,16 +56,16 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
| Total Jobs
.list-group
.list-group-item
- .badge.badge-primary 3
+ .badge.badge-primary {{overview["jobs-running"]}}
| Running
.list-group-item
- .badge.badge-success 6
+ .badge.badge-success {{overview["jobs-finished"]}}
| Finished
.list-group-item
- .badge.badge-info 0
+ .badge.badge-info {{overview["jobs-cancelled"]}}
| Canceled
.list-group-item
- .badge.badge-danger 2
+ .badge.badge-danger {{overview["jobs-failed"]}}
| Failed
//- .row
@@ -96,13 +96,13 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
tbody
tr(ng-repeat="job in runningJobs" ui-sref="single-job.plan({ jobid: job.jid })")
- td {{job['start-time']}}
- td {{job['end-time']}}
+ 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}}
- td {{job.jobname}}
+ td {{job.name}}
td {{job.jid}}
td.label-group
- bs-label(status="{{status}}" ng-repeat="(status, value) in job.operators") {{value}}
+ bs-label(status="{{status}}" ng-repeat="(status, value) in job.tasks") {{value}}
td
bs-label(status="{{job.state}}") {{job.state}}
@@ -124,12 +124,12 @@ nav.navbar.navbar-default.navbar-fixed-top.navbar-main
tbody
tr(ng-repeat="job in finishedJobs" ui-sref="single-job.plan({ jobid: job.jid })")
- td {{job['start-time']}}
- td {{job['end-time']}}
- td {{job.duration}}
- td {{job.jobname}}
+ td {{job['start-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
+ td {{job['end-time'] | amDateFormat:'YYYY-MM-DD, H:mm:ss'}}
+ td {{job['end-time'] - job['start-time']}} ms
+ td {{job.name}}
td {{job.jid}}
td.label-group
- bs-label(status="{{status}}" ng-repeat="(status, value) in job.operators") {{value}}
+ bs-label(status="{{status}}" ng-repeat="(status, value) in job.tasks") {{value}}
td
bs-label(status="{{job.state}}") {{job.state}}
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/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 8dcd734..83b51c1 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/common/filters.coffee
@@ -27,3 +27,8 @@ angular.module('flinkApp')
amDurationFormatExtendedFilter.$stateful = angularMomentConfig.statefulFilters
amDurationFormatExtendedFilter
+
+.filter "humanizeTaskName", ->
+ (text) ->
+ # TODO: extend... a lot
+ if text then text.replace(">", ">").replace("<br/>","") else ''
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/scripts/common/services.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/common/services.coffee b/flink-runtime-web/web-dashboard/app/scripts/common/services.coffee
new file mode 100644
index 0000000..2e45a44
--- /dev/null
+++ b/flink-runtime-web/web-dashboard/app/scripts/common/services.coffee
@@ -0,0 +1,34 @@
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+angular.module('flinkApp')
+
+.service 'MainService', ($http, flinkConfig, $q) ->
+ jobObservers = []
+
+ @loadConfig = ->
+ deferred = $q.defer()
+
+ $http.get flinkConfig.newServer + "/config"
+ .success (data, status, headers, config) ->
+ deferred.resolve(data)
+
+ deferred.promise
+
+
+ @
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/scripts/index.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/index.coffee b/flink-runtime-web/web-dashboard/app/scripts/index.coffee
index 3cea143..6c52e12 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/index.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/index.coffee
@@ -28,22 +28,25 @@ angular.module('flinkApp', ['ui.router', 'angularMoment'])
# --------------------------------------
-.constant 'flinkConfig', {
+.value 'flinkConfig', {
jobServer: 'http://localhost:8081'
newServer: 'http://localhost:8081'
# jobServer: 'http://localhost:3000/new-server'
# newServer: 'http://localhost:3000/new-server'
- refreshInterval: 10000
+ "refresh-interval": 10000
}
# --------------------------------------
-.run (JobsService, flinkConfig, $interval) ->
- JobsService.listJobs()
+.run (JobsService, MainService, flinkConfig, $interval) ->
+ MainService.loadConfig().then (config) ->
+ angular.extend flinkConfig, config
- # $interval ->
- # JobsService.listJobs()
- # , flinkConfig.refreshInterval
+ JobsService.listJobs()
+
+ $interval ->
+ JobsService.listJobs()
+ , flinkConfig["refresh-interval"]
# --------------------------------------
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.dir.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.dir.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.dir.coffee
index da83e83..15a3bb6 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.dir.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.dir.coffee
@@ -44,6 +44,7 @@ angular.module('flinkApp')
{
label: "Scheduled"
color: "#666"
+ borderColor: "#555"
starting_time: vTime["SCHEDULED"] * 100
ending_time: vTime["DEPLOYING"] * 100
type: 'regular'
@@ -51,6 +52,7 @@ angular.module('flinkApp')
{
label: "Deploying"
color: "#aaa"
+ borderColor: "#555"
starting_time: vTime["DEPLOYING"] * 100
ending_time: vTime["RUNNING"] * 100
type: 'regular'
@@ -58,6 +60,7 @@ angular.module('flinkApp')
{
label: "Running"
color: "#ddd"
+ borderColor: "#555"
starting_time: vTime["RUNNING"] * 100
ending_time: vTime["FINISHED"] * 100
type: 'regular'
@@ -76,7 +79,7 @@ angular.module('flinkApp')
label
)
.margin({ left: 100, right: 0, top: 0, bottom: 0 })
- .itemHeight(24)
+ .itemHeight(30)
.relativeTime()
svg = d3.select(svgEl)
@@ -111,8 +114,9 @@ angular.module('flinkApp')
times: [
label: "Scheduled"
color: "#cccccc"
+ borderColor: "#555"
starting_time: data.oldV["SCHEDULED"]
- ending_time: data.oldV["SCHEDULED"] + 30
+ ending_time: data.oldV["SCHEDULED"] + 1
# link: vertex.groupvertexid
type: 'scheduled'
]
@@ -126,7 +130,8 @@ angular.module('flinkApp')
testData.push
times: [
label: translateLabel(vertex.groupvertexname)
- color: "#62cdea"
+ color: "#d9f1f7"
+ borderColor: "#62cdea"
starting_time: vTime["STARTED"]
ending_time: vTime["ENDED"]
link: vertex.groupvertexid
@@ -146,7 +151,7 @@ angular.module('flinkApp')
})
.prefix("main")
.margin({ left: 0, right: 0, top: 0, bottom: 0 })
- .itemHeight(24)
+ .itemHeight(30)
.showBorderLine()
.showHourTimeline()
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
index 6640d60..72bdb6c 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/jobs.svc.coffee
@@ -69,21 +69,21 @@ angular.module('flinkApp')
@listJobs = ->
deferred = $q.defer()
- $http.get flinkConfig.newServer + "/jobs"
+ $http.get flinkConfig.newServer + "/joboverview"
.success (data, status, headers, config) ->
angular.forEach data, (list, listKey) ->
switch listKey
- when 'jobs-running' then jobs.running = list
- when 'jobs-finished' then jobs.finished = list
- when 'jobs-cancelled' then jobs.cancelled = list
- when 'jobs-failed' then jobs.failed = list
-
- angular.forEach list, (jobid, index) ->
- $http.get flinkConfig.newServer + "/jobs/" + jobid
- .success (details) ->
- list[index] = details
+ when 'running' then jobs.running = list
+ when 'finished' then jobs.finished = list
+ when 'cancelled' then jobs.cancelled = list
+ when 'failed' then jobs.failed = list
+
+ # angular.forEach list, (jobid, index) ->
+ # $http.get flinkConfig.newServer + "/jobs/" + jobid
+ # .success (details) ->
+ # list[index] = details
deferred.resolve(jobs)
notifyObservers()
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.ctrl.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.ctrl.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.ctrl.coffee
index 1a010e9..828f276 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.ctrl.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.ctrl.coffee
@@ -28,3 +28,6 @@ angular.module('flinkApp')
JobsService.unRegisterObserver($scope.jobObserver)
$scope.jobObserver()
+
+ OverviewService.loadOverview().then (data) ->
+ $scope.overview = data
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.svc.coffee
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.svc.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.svc.coffee
index 21e60b1..8ce9d61 100644
--- a/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.svc.coffee
+++ b/flink-runtime-web/web-dashboard/app/scripts/modules/overview/overview.svc.coffee
@@ -18,17 +18,17 @@
angular.module('flinkApp')
-.service 'OverviewService', ($http, flinkConfig, $log) ->
- serverStatus = {}
+.service 'OverviewService', ($http, flinkConfig, $q) ->
+ overview = {}
- @loadServerStatus = ->
- $http.get(flinkConfig.jobServer + "/monitor/status")
- .success (data, status, headers, config) ->
- $log data
+ @loadOverview = ->
+ deferred = $q.defer()
- .error (data, status, headers, config) ->
- return
+ $http.get(flinkConfig.jobServer + "/overview")
+ .success (data, status, headers, config) ->
+ overview = data
+ deferred.resolve(data)
- serverStatus
+ deferred.promise
@
http://git-wip-us.apache.org/repos/asf/flink/blob/b29a5d44/flink-runtime-web/web-dashboard/vendor-local/d3-timeline.js
----------------------------------------------------------------------
diff --git a/flink-runtime-web/web-dashboard/vendor-local/d3-timeline.js b/flink-runtime-web/web-dashboard/vendor-local/d3-timeline.js
index f12d478..aadca55 100644
--- a/flink-runtime-web/web-dashboard/vendor-local/d3-timeline.js
+++ b/flink-runtime-web/web-dashboard/vendor-local/d3-timeline.js
@@ -202,16 +202,18 @@
.attr("class", function(d, i) { return "bar-container bar-type-" + d.type; } )
.attr("width", getBarWidth);
- nel
- .append("svg:clipPath")
- .attr("id", prefix + "-timeline-textclip-" + i + "-" + index)
- .attr("class", "timeline-clip")
- .append("svg:rect")
- .attr("clipPathUnits","objectBoundingBox")
- .attr("x", getXPos)
- .attr("y", getStackPosition)
- .attr("width", getTextWidth)
- .attr("height", itemHeight);
+ if (data[0].type != "scheduled") {
+ nel
+ .append("svg:clipPath")
+ .attr("id", prefix + "-timeline-textclip-" + i + "-" + index)
+ .attr("class", "timeline-clip")
+ .append("svg:rect")
+ .attr("clipPathUnits","objectBoundingBox")
+ .attr("x", getXPos)
+ .attr("y", getStackPosition)
+ .attr("width", getTextWidth)
+ .attr("height", itemHeight);
+ }
var bar = nel
.append(function(d, i) {
@@ -219,6 +221,8 @@
})
.attr("x", getXPos)
.attr("y", getStackPosition)
+ .attr("rx", 5)
+ .attr("ry", 5)
.attr("width", getBarWidth)
.attr("cy", function(d, i) {
return getStackPosition(d, i) + itemHeight/2;
@@ -226,6 +230,8 @@
.attr("cx", getXPos)
.attr("r", itemHeight / 2)
.attr("height", itemHeight)
+ .style("stroke", function(d, i){ return d.borderColor; })
+ .style("stroke-width", 1)
.style("fill", function(d, i){
var dColorPropName;
if (d.color) return d.color;
@@ -263,12 +269,12 @@
return d.id ? d.id : "timelineItem_"+index+"_"+i;
})
- nel
+ var barText = nel
.append("text")
.attr("class", "timeline-insidelabel")
.attr("x", getXTextPos)
.attr("y", getStackTextPosition)
- .attr("width", getTextWidth)
+ // .attr("width", getTextWidth)
.attr("height", itemHeight)
.attr("clip-path", "url(#" + prefix + "-timeline-textclip-" + i + "-" + index + ")")
.text(function(d) {
@@ -279,6 +285,10 @@
});
;
+ if (data[0].type == "scheduled") {
+ bar.attr('width', barText.node().getComputedTextLength() + 10);
+ }
+
g.selectAll("svg .bar-container").each(function(d, i) {
$(this).qtip({
content: {
@@ -309,16 +319,19 @@
}
if (showBorderLine) {
- g.selectAll("svg").data(data).enter().append("svg:line")
- .attr("class", "line-" + 'start')
- .attr("x1", getBorderStart)
- .attr("y1", getStackPosition)
- .attr("x2", getBorderStart)
- .attr("y2", margin.top + (itemHeight + itemMargin) * maxStack)
- .style("stroke", function(d, i) { return d.color; })
- .style("stroke-width", showBorderFormat.width);
-
- if (data[0].type != "scheduled") {
+ if (data[0].type == "scheduled") {
+ g.selectAll("svg").data(data).enter().append("svg:line")
+ .attr("class", "line-" + 'start')
+ .attr("x1", getBorderStart)
+ .attr("y1", getStackBorderPosition)
+ .attr("x2", getBorderStart)
+ .attr("y2", margin.top + (itemHeight + itemMargin) * maxStack)
+ .style("stroke", function(d, i) { return d.color; })
+ .style("stroke-width", showBorderFormat.width);
+ }
+
+ // if (data[0].type != "scheduled") {
+ if (false) {
g.selectAll("svg").data(data).enter().append("svg:line")
.attr("class", "line-" + 'end')
.attr("x1", getBorderEnd)
@@ -358,9 +371,15 @@
}
function getStackTextPosition(d, i) {
if (stacked) {
- return margin.top + (itemHeight + itemMargin) * yAxisMapping[index] + itemHeight * 0.70;
+ return margin.top + (itemHeight + itemMargin) * yAxisMapping[index] + itemHeight * 0.65;
+ }
+ return margin.top + itemHeight * 0.65;
+ }
+ function getStackBorderPosition(d, i) {
+ if (stacked) {
+ return margin.top + (itemHeight + itemMargin) * yAxisMapping[index] + itemHeight - 3;
}
- return margin.top + itemHeight * 0.70;
+ return margin.top + itemHeight - 3;
}
});
});
@@ -426,7 +445,7 @@
setHeight();
bbox = g[0][0].getBBox();
- gParent.attr('height', bbox.height + 30);
+ gParent.attr('height', bbox.height + 40);
function getBorderStart(d, i) {
return xScale(d.starting_time);