You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by on...@apache.org on 2015/11/13 13:10:59 UTC
ambari git commit: AMBARI-13878. Incorrect calculating of task
duration (onechiporenko)
Repository: ambari
Updated Branches:
refs/heads/branch-2.1 21983a758 -> 203195cc7
AMBARI-13878. Incorrect calculating of task duration (onechiporenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/203195cc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/203195cc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/203195cc
Branch: refs/heads/branch-2.1
Commit: 203195cc7ec0f5197137314f7c1eafaf57cc13d0
Parents: 21983a7
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Nov 13 14:09:06 2015 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Fri Nov 13 14:10:45 2015 +0200
----------------------------------------------------------------------
.../app/controllers/global/background_operations_controller.js | 6 +++---
ambari-web/app/utils/date/date.js | 2 +-
ambari-web/test/utils/date/date_test.js | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/203195cc/ambari-web/app/controllers/global/background_operations_controller.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/global/background_operations_controller.js b/ambari-web/app/controllers/global/background_operations_controller.js
index bc05284..6bbbc19 100644
--- a/ambari-web/app/controllers/global/background_operations_controller.js
+++ b/ambari-web/app/controllers/global/background_operations_controller.js
@@ -240,8 +240,8 @@ App.BackgroundOperationsController = Em.Controller.extend({
isRunning: isRunning,
hostsMap: {},
tasks: [],
- startTime: request.Requests.start_time,
- endTime: request.Requests.end_time,
+ startTime: App.dateTimeWithTimeZone(request.Requests.start_time),
+ endTime: App.dateTimeWithTimeZone(request.Requests.end_time),
dependentService: requestParams.dependentService,
sourceRequestScheduleId: request.Requests.request_schedule && request.Requests.request_schedule.schedule_id,
previousTaskStatusMap: {},
@@ -259,7 +259,7 @@ App.BackgroundOperationsController = Em.Controller.extend({
this.removeOldRequests(currentRequestIds);
this.set("allOperationsCount", runningServices);
this.set('isShowMoreAvailable', countGot >= countIssued);
- this.set('serviceTimestamp', App.dateTime());
+ this.set('serviceTimestamp', App.dateTimeWithTimeZone());
},
isShowMoreAvailable: null,
/**
http://git-wip-us.apache.org/repos/asf/ambari/blob/203195cc/ambari-web/app/utils/date/date.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/date/date.js b/ambari-web/app/utils/date/date.js
index c51f043..5541d22 100644
--- a/ambari-web/app/utils/date/date.js
+++ b/ambari-web/app/utils/date/date.js
@@ -134,7 +134,7 @@ module.exports = {
return '' + this.timingFormat(endTimestamp - startTimestamp, 1); //lasted for xx secs
} else {
// still running, duration till now
- var time = (App.dateTime() - startTimestamp) < 0 ? 0 : (App.dateTime() - startTimestamp);
+ var time = (App.dateTimeWithTimeZone() - startTimestamp) < 0 ? 0 : (App.dateTimeWithTimeZone() - startTimestamp);
durationSummary = '' + this.timingFormat(time, 1);
}
return durationSummary;
http://git-wip-us.apache.org/repos/asf/ambari/blob/203195cc/ambari-web/test/utils/date/date_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/utils/date/date_test.js b/ambari-web/test/utils/date/date_test.js
index 630b3a8..1ccfb31 100644
--- a/ambari-web/test/utils/date/date_test.js
+++ b/ambari-web/test/utils/date/date_test.js
@@ -167,7 +167,7 @@ describe('date', function () {
];
beforeEach(function() {
- sinon.stub(App, 'dateTime', function () { return 100019000; });
+ sinon.stub(App, 'dateTimeWithTimeZone', function () { return 100019000; });
});
tests.forEach(function(test) {
@@ -178,7 +178,7 @@ describe('date', function () {
});
afterEach(function() {
- App.dateTime.restore();
+ App.dateTimeWithTimeZone.restore();
});
});