Merge pull request !621 from 潘慧/master_phtags/v1.0.0
| @@ -394,7 +394,7 @@ export default { | |||||
| * Dimension selection changed | * Dimension selection changed | ||||
| */ | */ | ||||
| filterChange() { | filterChange() { | ||||
| // 校验检索条件 | |||||
| // filter condition | |||||
| let filterCorrect = true; | let filterCorrect = true; | ||||
| let incorrectData = false; | let incorrectData = false; | ||||
| let limitCount = 2; | let limitCount = 2; | ||||
| @@ -370,4 +370,11 @@ export default { | |||||
| params: params, | params: params, | ||||
| }); | }); | ||||
| }, | }, | ||||
| retrieveTensorHistory(params) { | |||||
| return axios({ | |||||
| method: 'post', | |||||
| url: 'v1/mindinsight/debugger/retrieve_tensor_history', | |||||
| data: params, | |||||
| }); | |||||
| }, | |||||
| }; | }; | ||||
| @@ -472,6 +472,10 @@ export default { | |||||
| this.searchByTypeInput = ''; | this.searchByTypeInput = ''; | ||||
| this.searchByNameInput = ''; | this.searchByNameInput = ''; | ||||
| this.op_filter_condition = {}; | this.op_filter_condition = {}; | ||||
| this.op_sort_condition = { | |||||
| name: 'avg_time', | |||||
| type: 'descending', | |||||
| }; | |||||
| this.opTypeCol = []; | this.opTypeCol = []; | ||||
| this.opTypeList = []; | this.opTypeList = []; | ||||
| this.opAllTypeList = { | this.opAllTypeList = { | ||||
| @@ -98,10 +98,12 @@ limitations under the License. | |||||
| <div class="title-wrap"> | <div class="title-wrap"> | ||||
| <div class="title">{{ $t('profiling.timeLine') }}</div> | <div class="title">{{ $t('profiling.timeLine') }}</div> | ||||
| <div class="view-detail"> | <div class="view-detail"> | ||||
| <button @click="downloadPerfetto()" | |||||
| :disabled="timeLine.waiting" | |||||
| :class="{disabled:timeLine.waiting}">{{ $t('profiling.downloadTimeline') }} | |||||
| <button @click="downloadTimelineFile()" | |||||
| v-show="!timeLine.waiting" | |||||
| :disabled="timeLine.disable" | |||||
| :class="{disabled:timeLine.disable}">{{ $t('profiling.downloadTimeline') }} | |||||
| </button> | </button> | ||||
| <div class="el-icon-loading loading-icon" v-show="timeLine.waiting"></div> | |||||
| </div> | </div> | ||||
| <div class="tip-icon"> | <div class="tip-icon"> | ||||
| <el-tooltip placement="bottom" | <el-tooltip placement="bottom" | ||||
| @@ -191,6 +193,7 @@ export default { | |||||
| // Time line data | // Time line data | ||||
| data: null, | data: null, | ||||
| waiting: true, // Is it waiting for interface return | waiting: true, // Is it waiting for interface return | ||||
| disable: true, | |||||
| }, | }, | ||||
| timelineInfo: { | timelineInfo: { | ||||
| // Time line information | // Time line information | ||||
| @@ -212,6 +215,7 @@ export default { | |||||
| this.pieChart.noData = true; | this.pieChart.noData = true; | ||||
| this.pieChart.initOver = true; | this.pieChart.initOver = true; | ||||
| this.timelineInfo.initOver = true; | this.timelineInfo.initOver = true; | ||||
| this.timeLine.waiting = false; | |||||
| } | } | ||||
| if (newValue.query.dir && newValue.query.id && newValue.query.path) { | if (newValue.query.dir && newValue.query.id && newValue.query.path) { | ||||
| this.summaryPath = newValue.query.dir; | this.summaryPath = newValue.query.dir; | ||||
| @@ -369,23 +373,12 @@ export default { | |||||
| this.pieChart.initOver = true; | this.pieChart.initOver = true; | ||||
| }); | }); | ||||
| }, | }, | ||||
| /** | |||||
| * Converts a string to data in uint8array format | |||||
| * @param {String} str The string to be converted | |||||
| * @return {Array} | |||||
| */ | |||||
| stringToUint8Array(str) { | |||||
| const arr = []; | |||||
| for (let i = 0, strLen = str.length; i < strLen; i++) { | |||||
| arr.push(str.charCodeAt(i)); | |||||
| } | |||||
| return new Uint8Array(arr); | |||||
| }, | |||||
| /** | /** | ||||
| * Query the data of time line | * Query the data of time line | ||||
| */ | */ | ||||
| queryTimeline() { | queryTimeline() { | ||||
| this.timeLine.waiting = true; | this.timeLine.waiting = true; | ||||
| this.timeLine.disable = true; | |||||
| const params = { | const params = { | ||||
| dir: this.relativePath, | dir: this.relativePath, | ||||
| device_id: this.currentCard, | device_id: this.currentCard, | ||||
| @@ -417,17 +410,20 @@ export default { | |||||
| }); | }); | ||||
| RequestService.queryTimeline(params) | RequestService.queryTimeline(params) | ||||
| .then((res) => { | .then((res) => { | ||||
| this.timeLine.waiting = false; | |||||
| if (res && res.data && res.data.length) { | if (res && res.data && res.data.length) { | ||||
| this.timeLine.data = JSON.stringify(res.data); | this.timeLine.data = JSON.stringify(res.data); | ||||
| this.timeLine.waiting = false; | |||||
| this.timeLine.disable = false; | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(() => {}); | |||||
| .catch(() => { | |||||
| this.timeLine.waiting = false; | |||||
| }); | |||||
| }, | }, | ||||
| /** | /** | ||||
| * Download Perfetto data file | |||||
| * Download timeline data file | |||||
| */ | */ | ||||
| downloadPerfetto() { | |||||
| downloadTimelineFile() { | |||||
| const downloadLink = document.createElement('a'); | const downloadLink = document.createElement('a'); | ||||
| downloadLink.download = this.getDocName(); | downloadLink.download = this.getDocName(); | ||||
| downloadLink.style.display = 'none'; | downloadLink.style.display = 'none'; | ||||
| @@ -521,7 +517,6 @@ export default { | |||||
| .view-detail { | .view-detail { | ||||
| float: right; | float: right; | ||||
| cursor: pointer; | cursor: pointer; | ||||
| color: #00a5a7; | |||||
| font-size: 12px; | font-size: 12px; | ||||
| height: 24px; | height: 24px; | ||||
| line-height: 24px; | line-height: 24px; | ||||
| @@ -546,6 +541,9 @@ export default { | |||||
| display: block; | display: block; | ||||
| } | } | ||||
| } | } | ||||
| .loading-icon { | |||||
| margin-left: 5px; | |||||
| } | |||||
| .coming-soon-content { | .coming-soon-content { | ||||
| height: calc(100% - 50px); | height: calc(100% - 50px); | ||||
| position: relative; | position: relative; | ||||
| @@ -557,6 +557,10 @@ export default { | |||||
| this.searchByCpuTypeInput = ''; | this.searchByCpuTypeInput = ''; | ||||
| this.searchAllByCpuTypeInput = ''; | this.searchAllByCpuTypeInput = ''; | ||||
| this.op_cpu_filter_condition = {}; | this.op_cpu_filter_condition = {}; | ||||
| this.op_cpu_sort_condition = { | |||||
| name: 'execution_time', | |||||
| type: 'descending', | |||||
| }; | |||||
| this.opCpuTypeCol = []; | this.opCpuTypeCol = []; | ||||
| this.opCpuTypeList = []; | this.opCpuTypeList = []; | ||||
| this.opCpuAllTypeList = { | this.opCpuAllTypeList = { | ||||
| @@ -578,6 +582,10 @@ export default { | |||||
| this.searchByTypeInput = ''; | this.searchByTypeInput = ''; | ||||
| this.searchByNameInput = ''; | this.searchByNameInput = ''; | ||||
| this.op_filter_condition = {}; | this.op_filter_condition = {}; | ||||
| this.op_sort_condition = { | |||||
| name: 'execution_time', | |||||
| type: 'descending', | |||||
| }; | |||||
| this.opTypeCol = []; | this.opTypeCol = []; | ||||
| this.opTypeList = []; | this.opTypeList = []; | ||||
| this.opAllTypeList = { | this.opAllTypeList = { | ||||
| @@ -304,10 +304,12 @@ limitations under the License. | |||||
| <div class="title-wrap"> | <div class="title-wrap"> | ||||
| <div class="title">{{ $t('profiling.timeLine') }}</div> | <div class="title">{{ $t('profiling.timeLine') }}</div> | ||||
| <div class="view-detail"> | <div class="view-detail"> | ||||
| <button @click="downloadPerfetto()" | |||||
| :disabled="timeLine.waiting" | |||||
| :class="{disabled:timeLine.waiting}">{{ $t('profiling.downloadTimeline') }} | |||||
| <button @click="downloadTimelineFile()" | |||||
| v-show="!timeLine.waiting" | |||||
| :disabled="timeLine.disable" | |||||
| :class="{disabled:timeLine.disable}">{{ $t('profiling.downloadTimeline') }} | |||||
| </button> | </button> | ||||
| <div class="el-icon-loading loading-icon" v-show="timeLine.waiting"></div> | |||||
| </div> | </div> | ||||
| <div class="tip-icon"> | <div class="tip-icon"> | ||||
| <el-tooltip placement="bottom" | <el-tooltip placement="bottom" | ||||
| @@ -439,6 +441,7 @@ export default { | |||||
| // Time line data | // Time line data | ||||
| data: null, | data: null, | ||||
| waiting: true, // Is it waiting for interface return | waiting: true, // Is it waiting for interface return | ||||
| disable: true, | |||||
| }, | }, | ||||
| timelineInfo: { | timelineInfo: { | ||||
| // Time line information | // Time line information | ||||
| @@ -485,6 +488,7 @@ export default { | |||||
| this.pieChart.initOver = true; | this.pieChart.initOver = true; | ||||
| this.timelineInfo.initOver = true; | this.timelineInfo.initOver = true; | ||||
| this.processSummary.initOver = true; | this.processSummary.initOver = true; | ||||
| this.timeLine.waiting = false; | |||||
| } | } | ||||
| if ( | if ( | ||||
| newValue.query.dir && | newValue.query.dir && | ||||
| @@ -1094,23 +1098,12 @@ export default { | |||||
| this.svg.resizeTimer = null; | this.svg.resizeTimer = null; | ||||
| }, 500); | }, 500); | ||||
| }, | }, | ||||
| /** | |||||
| * Converts a string to data in uint8array format | |||||
| * @param {String} str The string to be converted | |||||
| * @return {Array} | |||||
| */ | |||||
| stringToUint8Array(str) { | |||||
| const arr = []; | |||||
| for (let i = 0, strLen = str.length; i < strLen; i++) { | |||||
| arr.push(str.charCodeAt(i)); | |||||
| } | |||||
| return new Uint8Array(arr); | |||||
| }, | |||||
| /** | /** | ||||
| * Query the data of time line | * Query the data of time line | ||||
| */ | */ | ||||
| queryTimeline() { | queryTimeline() { | ||||
| this.timeLine.waiting = true; | this.timeLine.waiting = true; | ||||
| this.timeLine.disable = true; | |||||
| const params = { | const params = { | ||||
| dir: this.relativePath, | dir: this.relativePath, | ||||
| device_id: this.currentCard, | device_id: this.currentCard, | ||||
| @@ -1141,17 +1134,20 @@ export default { | |||||
| }); | }); | ||||
| RequestService.queryTimeline(params) | RequestService.queryTimeline(params) | ||||
| .then((res) => { | .then((res) => { | ||||
| this.timeLine.waiting = false; | |||||
| if (res && res.data && res.data.length) { | if (res && res.data && res.data.length) { | ||||
| this.timeLine.data = JSON.stringify(res.data); | this.timeLine.data = JSON.stringify(res.data); | ||||
| this.timeLine.waiting = false; | |||||
| this.timeLine.disable = false; | |||||
| } | } | ||||
| }) | }) | ||||
| .catch(() => {}); | |||||
| .catch(() => { | |||||
| this.timeLine.waiting = false; | |||||
| }); | |||||
| }, | }, | ||||
| /** | /** | ||||
| * Download Perfetto data file | |||||
| * Download timeline data file | |||||
| */ | */ | ||||
| downloadPerfetto() { | |||||
| downloadTimelineFile() { | |||||
| const downloadLink = document.createElement('a'); | const downloadLink = document.createElement('a'); | ||||
| downloadLink.download = this.getDocName(); | downloadLink.download = this.getDocName(); | ||||
| downloadLink.style.display = 'none'; | downloadLink.style.display = 'none'; | ||||
| @@ -1281,7 +1277,6 @@ export default { | |||||
| .view-detail { | .view-detail { | ||||
| float: right; | float: right; | ||||
| cursor: pointer; | cursor: pointer; | ||||
| color: #00a5a7; | |||||
| font-size: 12px; | font-size: 12px; | ||||
| height: 24px; | height: 24px; | ||||
| line-height: 24px; | line-height: 24px; | ||||
| @@ -1306,6 +1301,9 @@ export default { | |||||
| display: block; | display: block; | ||||
| } | } | ||||
| } | } | ||||
| .loading-icon { | |||||
| margin-left: 5px; | |||||
| } | |||||
| .coming-soon-content { | .coming-soon-content { | ||||
| height: calc(100% - 50px); | height: calc(100% - 50px); | ||||
| position: relative; | position: relative; | ||||