[FLINK-5145] WebInterface only polls selected metrics This closes #2867.
Project: http://git-wip-us.apache.org/repos/asf/flink/repo Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/1cc887e3 Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/1cc887e3 Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/1cc887e3 Branch: refs/heads/master Commit: 1cc887e31f9c70070c3ea0107a5d1b1413dff828 Parents: fc62723 Author: zentol <[email protected]> Authored: Wed Nov 23 13:08:12 2016 +0100 Committer: zentol <[email protected]> Committed: Tue Dec 13 13:57:28 2016 +0100 ---------------------------------------------------------------------- .../app/scripts/modules/jobs/metrics.svc.coffee | 21 ++++++------ flink-runtime-web/web-dashboard/web/js/index.js | 34 +++++++++----------- 2 files changed, 26 insertions(+), 29 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/flink/blob/1cc887e3/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee ---------------------------------------------------------------------- diff --git a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee index e169d6d..20c7439 100644 --- a/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee +++ b/flink-runtime-web/web-dashboard/app/scripts/modules/jobs/metrics.svc.coffee @@ -29,17 +29,16 @@ angular.module('flinkApp') } @refresh = $interval => - angular.forEach @watched, (v, jobid) => - angular.forEach v, (nodeid, nk) => - @getAllAvailableMetrics(jobid, nodeid).then (data) => - names = [] - angular.forEach data, (metric, mk) => - names.push metric.id - - if names.length > 0 - @getMetrics(jobid, nodeid, names).then (values) => - if jobid == @observer.jobid && nodeid == @observer.nodeid - @observer.callback(values) if @observer.callback + angular.forEach @metrics, (vertices, jobid) => + angular.forEach vertices, (metrics, nodeid) => + names = [] + angular.forEach metrics, (metric, index) => + names.push metric.id + + if names.length > 0 + @getMetrics(jobid, nodeid, names).then (values) => + if jobid == @observer.jobid && nodeid == @observer.nodeid + @observer.callback(values) if @observer.callback , flinkConfig["refresh-interval"]
