Browse Source

AMBARI-5174. Ambari UI shows Tez DAG vertex times cumulative (alexantonenko)

Alex Antonenko 11 năm trước cách đây
mục cha
commit
7c02ccbf30

+ 4 - 1
ambari-web/app/utils/date.js

@@ -31,7 +31,7 @@ module.exports = {
    * @param timestamp
    * @return string date
    */
-  dateFormat:function (timestamp, showSeconds) {
+  dateFormat:function (timestamp, showSeconds, showMilliseconds) {
     if (!validator.isValidInt(timestamp)) return timestamp;
     var date = new Date(timestamp);
     var months = this.dateMonths;
@@ -39,6 +39,9 @@ module.exports = {
     var formattedDate = days[date.getDay()] + ', ' + months[date.getMonth()] + ' ' + this.dateFormatZeroFirst(date.getDate()) + ', ' + date.getFullYear() + ' ' + this.dateFormatZeroFirst(date.getHours()) + ':' + this.dateFormatZeroFirst(date.getMinutes());
     if (showSeconds) {
       formattedDate += ':' + this.dateFormatZeroFirst(date.getSeconds());
+      if (showMilliseconds) {
+        formattedDate += '.' + this.dateFormatZeroFirst(date.getMilliseconds());
+      };
     };
     return formattedDate;
   },

+ 2 - 2
ambari-web/app/views/main/jobs/hive_job_details_view.js

@@ -241,8 +241,8 @@ App.MainHiveJobDetailsView = Em.View.extend({
         read : v.get('recordReadCount') == null ? null : Em.I18n.t('jobs.hive.tez.records.count').format(v.get('recordReadCount')),
         write : v.get('recordWriteCount') == null ? null : Em.I18n.t('jobs.hive.tez.records.count').format(v.get('recordWriteCount'))
       },
-      started: v.get('startTime') ? dateUtils.dateFormat(v.get('startTime'), true) : '',
-      ended: v.get('endTime') ? dateUtils.dateFormat(v.get('endTime'), true) : '',
+      started: v.get('startTime') ? dateUtils.dateFormat(v.get('startTime'), true, true) : '',
+      ended: v.get('endTime') ? dateUtils.dateFormat(v.get('endTime'), true, true) : '',
       status: status
     };
   }.property('selectedVertex.fileReadOps', 'selectedVertex.fileWriteOps', 'selectedVertex.hdfsReadOps', 'selectedVertex.hdfdWriteOps',