From 6941033396e3078204ba8e722d67394b054eeffe Mon Sep 17 00:00:00 2001 From: Sunil G Date: Wed, 6 Mar 2019 16:49:08 +0530 Subject: [PATCH] YARN-8803. [UI2] Show flow runs in the order of recently created time in graph widgets. Contributed by Akhil PB. (cherry picked from commit c79f139519e9b2486de31b307d7811b4c2a6b5b0) --- .../src/main/webapp/app/controllers/yarn-flow/runs.js | 2 +- .../src/main/webapp/app/models/yarn-flowrun-brief.js | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow/runs.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow/runs.js index def4c129a9e..a6c14628ddc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow/runs.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-flow/runs.js @@ -165,7 +165,7 @@ export default Ember.Controller.extend({ getSortedVizDataInDesc: function(data) { return data.sort(function(d1, d2) { - return d2.value - d1.value; + return d2.createdTs - d1.createdTs; }); }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.js index 8d9fca36dcd..9bcf1e174e2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-flowrun-brief.js @@ -46,7 +46,8 @@ export default DS.Model.extend({ label: this.get('runid'), value: this.get('runDurationTs'), tooltip: this.get("shownid") + "
" + Converter.msToElapsedTimeUnit(this.get('runDurationTs')), - flowrunUid: this.get('uid') + flowrunUid: this.get('uid'), + createdTs: this.get('createTimeRaw') }; }, @@ -55,7 +56,8 @@ export default DS.Model.extend({ label: this.get('runid'), value: this.get('cpuVCores'), tooltip: this.get("shownid") + "
" + 'CPU VCores: ' + this.get('cpuVCores'), - flowrunUid: this.get('uid') + flowrunUid: this.get('uid'), + createdTs: this.get('createTimeRaw') }; }, @@ -64,7 +66,8 @@ export default DS.Model.extend({ label: this.get('runid'), value: this.get('memoryUsed'), tooltip: this.get("shownid") + "
" + 'Memory Used: ' + Converter.memoryBytesToMB(this.get('memoryUsed')), - flowrunUid: this.get('uid') + flowrunUid: this.get('uid'), + createdTs: this.get('createTimeRaw') }; } });