From 90b748851af4af67f4771480ecad34200f1522af Mon Sep 17 00:00:00 2001 From: zombieJ Date: Wed, 11 Jan 2017 16:29:53 +0800 Subject: [PATCH] support attempt --- .../webapp/app/apps/jpm/ctrl/detailCtrl.js | 19 +++++++ .../app/apps/jpm/partials/job/detail.html | 50 +++++++++++++++++++ .../app/dev/public/js/components/sortTable.js | 3 +- .../app/dev/public/js/components/widget.js | 8 ++- 4 files changed, 78 insertions(+), 2 deletions(-) diff --git a/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/ctrl/detailCtrl.js b/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/ctrl/detailCtrl.js index be7631f9ae..905f270668 100644 --- a/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/ctrl/detailCtrl.js +++ b/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/ctrl/detailCtrl.js @@ -123,6 +123,25 @@ $scope.endTimestamp = $scope.job.endTime; $scope.isRunning = !$scope.job.currentState || ($scope.job.currentState || "").toUpperCase() === 'RUNNING'; + + // =============================== task attempt =============================== + if ($scope.job.currentState === 'FAILED') { + $scope.taskAttemptList = JPM.list('TaskAttemptErrorCategoryService', { + site: $scope.job.tags.site, + jobId: $scope.job.tags.jobId + }, + Time($scope.startTimestamp).subtract(1, 'day'), + Time($scope.endTimestamp).add(1, 'day')); + $scope.taskAttemptCategories = {}; + $scope.taskAttemptList._promise.then(function () { + $.each($scope.taskAttemptList, function (i, attempt) { + $scope.taskAttemptCategories[attempt.tags.errorCategory] = + ($scope.taskAttemptCategories[attempt.tags.errorCategory] || 0) + 1; + }); + }); + } + + // ================================ dashboards ================================ // Dashboard 1: Allocated MB metric_allocatedMB = JPM.metrics(jobCond, "hadoop.job.allocatedmb", startTime, endTime); diff --git a/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/partials/job/detail.html b/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/partials/job/detail.html index fb8f7b8db1..359b043c28 100644 --- a/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/partials/job/detail.html +++ b/eagle-jpm/eagle-jpm-web/src/main/webapp/app/apps/jpm/partials/job/detail.html @@ -170,6 +170,56 @@

+ +
+
+

+ Error Task Attempts + + + ( + , + {{category}}: {{count}} + ) + + + +

+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + +
Start TimeEnd TimeHostTypeAttemptError Category
{{Time.format(item.startTime)}}{{Time.format(item.endTime)}}{{item.tags.hostname || "-"}}{{item.tags.taskType || "-"}}{{item.tags.taskAttemptId || "-"}}{{item.tags.errorCategory || "-"}}
+
+
+
+ +

diff --git a/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js b/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js index a1e91df74d..7a312c9744 100644 --- a/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js +++ b/eagle-server/src/main/webapp/app/dev/public/js/components/sortTable.js @@ -37,6 +37,7 @@ * @param {string?} $attrs.scope Will bind parent variable of current scope * @param {string?} $attrs.sortpath Default sort path * @param {[]?} $attrs.searchPathList Filter search path list + * @param {string?} $attrs.maxSize Set max display size of page */ controller: function($scope, $element, $attrs) { var sortmatch; @@ -49,7 +50,7 @@ // Initialization $scope.pageNumber = 1; $scope.pageSize = 10; - $scope.maxSize = 10; + $scope.maxSize = $attrs.maxSize || 10; $scope.search = ""; $scope.orderKey = ""; $scope.orderAsc = true; diff --git a/eagle-server/src/main/webapp/app/dev/public/js/components/widget.js b/eagle-server/src/main/webapp/app/dev/public/js/components/widget.js index bc59b3c4ff..cbb4e2b2f6 100644 --- a/eagle-server/src/main/webapp/app/dev/public/js/components/widget.js +++ b/eagle-server/src/main/webapp/app/dev/public/js/components/widget.js @@ -29,13 +29,19 @@ controller: function($scope, $element, $attrs) { }, compile: function ($element) { - $element.contents().remove(); + var $content = $element.contents().remove(); return { post: function preLink($scope, $element) { var widget = $scope.widget; $scope.site = Site.current(); + // If not set widget, skip dynamic render. (AdminLTE use `data-widget` as attr key) + if (!widget) { + $element.append($content); + return; + } + if(widget.renderFunc) { // Prevent auto compile if return false if(widget.renderFunc($element, $scope, $compile) !== false) {