提交 c7cb5e0c 编写于 作者: P ph

update profiler

上级 9e41cd5c
...@@ -81,7 +81,7 @@ limitations under the License. ...@@ -81,7 +81,7 @@ limitations under the License.
type="primary" type="primary"
size="mini" size="mini"
plain plain
v-if="(!noData&&echart.allData.length) || v-if="(!noData&&basearr.length) ||
(noData && summaryDirList && !summaryDirList.length)"> (noData && summaryDirList && !summaryDirList.length)">
{{ $t('modelTraceback.showAllData') }}</el-button> {{ $t('modelTraceback.showAllData') }}</el-button>
</div> </div>
......
...@@ -209,7 +209,6 @@ ...@@ -209,7 +209,6 @@
width="50%" width="50%"
:close-on-click-modal="false" :close-on-click-modal="false"
class="details-data-list"> class="details-data-list">
<div class="details-data-title">{{ detailsDataTitle }}</div>
<el-table :data="detailsDataList" <el-table :data="detailsDataList"
row-key="id" row-key="id"
lazy lazy
...@@ -240,25 +239,25 @@ export default { ...@@ -240,25 +239,25 @@ export default {
data() { data() {
return { return {
apiType: 'core', apiType: 'core',
currentCard: {value: '', option: []}, currentCard: {value: '', option: []}, // current device
cpuCharts: { cpuCharts: {
type: 1, type: 1,
id: 'cpu-echarts', id: 'cpu-echarts',
chartDom: null, chartDom: null,
data: [], data: [],
}, }, // ai cpu chart
coreCharts: { coreCharts: {
type: 0, type: 0,
id: 'core-echarts', id: 'core-echarts',
chartDom: null, chartDom: null,
data: [], data: [],
}, }, // ai core chart
statisticType: 0, statisticType: 0, // ai core table statistic type
searchByTypeInput: '', searchByTypeInput: '', // search by ai core type name
searchByNameInput: '', searchByNameInput: '', // search by ai core detail name
searchByCPUNameInput: '', searchByCPUNameInput: '', // search by ai cpu name
opTypeCol: [], opTypeCol: [], // table headers list of operator type
opTypeList: [], opTypeList: [], // table list of operator type
opCpuList: { opCpuList: {
opDetailCol: [], opDetailCol: [],
opDetailList: [], opDetailList: [],
...@@ -272,8 +271,7 @@ export default { ...@@ -272,8 +271,7 @@ export default {
name: 'total_time', name: 'total_time',
type: 'descending', type: 'descending',
}, },
}, }, // table data of operator cpu
opAllDetailCol: [],
opAllTypeList: { opAllTypeList: {
opDetailCol: [], opDetailCol: [],
opDetailList: [], opDetailList: [],
...@@ -284,18 +282,17 @@ export default { ...@@ -284,18 +282,17 @@ export default {
}, },
op_filter_condition: {}, op_filter_condition: {},
op_sort_condition: {}, op_sort_condition: {},
}, }, // table data of all operator details
detailsDataTitle: '', rowName: this.$t('dataTraceback.details'), // dialog title
rowName: this.$t('dataTraceback.details'), detailsDataList: [], // dialog table data
detailsDataList: [], detailsDialogVisible: false, // show dialog
detailsDialogVisible: false, profile_dir: '', // profile directory
profile_dir: '', train_id: '', // train id
train_id: '', op_filter_condition: {}, // operator type filter
op_filter_condition: {},
op_sort_condition: { op_sort_condition: {
name: 'execution_time', name: 'execution_time',
type: 'descending', type: 'descending',
}, }, // operator type filter
initOver: false, initOver: false,
objectType: 'object', objectType: 'object',
}; };
...@@ -308,16 +305,22 @@ export default { ...@@ -308,16 +305,22 @@ export default {
init() { init() {
this.getDeviceList(); this.getDeviceList();
}, },
/**
* Current device change
*/
cardChange() { cardChange() {
this.clearCpuData();
this.clearCoreData();
if (this.apiType === 'core') { if (this.apiType === 'core') {
this.statisticType = 0; this.statisticType = 0;
this.clearCoreData();
this.getCoreTypeList(); this.getCoreTypeList();
} else if (this.apiType === 'cpu') { } else if (this.apiType === 'cpu') {
this.clearCpuData();
this.getCpuList(true); this.getCpuList(true);
} }
}, },
/**
* clear cpu data
*/
clearCpuData() { clearCpuData() {
this.searchByCPUNameInput = ''; this.searchByCPUNameInput = '';
this.opCpuList = { this.opCpuList = {
...@@ -335,6 +338,9 @@ export default { ...@@ -335,6 +338,9 @@ export default {
}, },
}; };
}, },
/**
* clear core data
*/
clearCoreData() { clearCoreData() {
this.searchByTypeInput = ''; this.searchByTypeInput = '';
this.searchByNameInput = ''; this.searchByNameInput = '';
...@@ -353,6 +359,9 @@ export default { ...@@ -353,6 +359,9 @@ export default {
op_sort_condition: {}, op_sort_condition: {},
}; };
}, },
/**
* get device list
*/
getDeviceList() { getDeviceList() {
const params = { const params = {
profile: this.profile_dir, profile: this.profile_dir,
...@@ -381,6 +390,9 @@ export default { ...@@ -381,6 +390,9 @@ export default {
this.initOver = true; this.initOver = true;
}); });
}, },
/**
* get core list
*/
getCoreTypeList() { getCoreTypeList() {
const params = {}; const params = {};
params.params = { params.params = {
...@@ -461,6 +473,10 @@ export default { ...@@ -461,6 +473,10 @@ export default {
this.initOver = true; this.initOver = true;
}); });
}, },
/**
* get core detail list
* @param {Object} row type row
*/
getCoreDetailList(row) { getCoreDetailList(row) {
const params = {}; const params = {};
params.params = { params.params = {
...@@ -483,6 +499,9 @@ export default { ...@@ -483,6 +499,9 @@ export default {
}) })
.catch(() => {}); .catch(() => {});
}, },
/**
* get cpu list
*/
getCpuList() { getCpuList() {
const params = {}; const params = {};
params.params = { params.params = {
...@@ -529,14 +548,27 @@ export default { ...@@ -529,14 +548,27 @@ export default {
this.initOver = true; this.initOver = true;
}); });
}, },
/**
* operator detail list page change
* @param {Object} row table cell
* @param {Number} pageIndex current page
*/
opDetailPageChange(row, pageIndex) { opDetailPageChange(row, pageIndex) {
row.opDetailPage.offset = pageIndex - 1; row.opDetailPage.offset = pageIndex - 1;
this.getCoreDetailList(row); this.getCoreDetailList(row);
}, },
/**
* cpu list page change
* @param {Object} row table cell
* @param {Number} pageIndex current page
*/
opCpuPageChange(row, pageIndex) { opCpuPageChange(row, pageIndex) {
row.opDetailPage.offset = pageIndex - 1; row.opDetailPage.offset = pageIndex - 1;
this.getCpuList(); this.getCpuList();
}, },
/**
* get core list by search
*/
searchOpCoreList() { searchOpCoreList() {
if (this.statisticType) { if (this.statisticType) {
this.opAllTypeList.op_filter_condition = {}; this.opAllTypeList.op_filter_condition = {};
...@@ -560,6 +592,9 @@ export default { ...@@ -560,6 +592,9 @@ export default {
this.getCoreTypeList(); this.getCoreTypeList();
} }
}, },
/**
* get cpu list by search
*/
searchOpCpuList() { searchOpCpuList() {
this.opCpuList.op_filter_condition = {}; this.opCpuList.op_filter_condition = {};
if (this.searchByCPUNameInput) { if (this.searchByCPUNameInput) {
...@@ -571,6 +606,11 @@ export default { ...@@ -571,6 +606,11 @@ export default {
} }
this.getCpuList(); this.getCpuList();
}, },
/**
* core detail sort
* @param {Object} row table cell
* @param {Object} column table cell
*/
coreDetailSortChange(row, column) { coreDetailSortChange(row, column) {
row.op_sort_condition = { row.op_sort_condition = {
name: column.prop, name: column.prop,
...@@ -579,6 +619,11 @@ export default { ...@@ -579,6 +619,11 @@ export default {
row.opDetailPage.offset = 0; row.opDetailPage.offset = 0;
this.getCoreDetailList(row); this.getCoreDetailList(row);
}, },
/**
* cpu detail sort
* @param {Object} row table cell
* @param {Object} column table cell
*/
cpuDetailSortChange(row, column) { cpuDetailSortChange(row, column) {
row.op_sort_condition = { row.op_sort_condition = {
name: column.prop, name: column.prop,
...@@ -587,6 +632,11 @@ export default { ...@@ -587,6 +632,11 @@ export default {
row.opDetailPage.offset = 0; row.opDetailPage.offset = 0;
this.getCpuList(); this.getCpuList();
}, },
/**
* format detail data
* @param {Object} row table cell
* @param {Object} detailsDataList table detail
*/
formatterDetailData(row, detailsDataList) { formatterDetailData(row, detailsDataList) {
row.opDetailList = []; row.opDetailList = [];
row.opDetailCol = detailsDataList.col_name; row.opDetailCol = detailsDataList.col_name;
...@@ -605,7 +655,11 @@ export default { ...@@ -605,7 +655,11 @@ export default {
}); });
} }
}, },
expandTypeItem(row, data, data2) { /**
* expand core type table
* @param {Object} row table cell
*/
expandTypeItem(row) {
row.isExpanded = !row.isExpanded; row.isExpanded = !row.isExpanded;
if (row.isExpanded) { if (row.isExpanded) {
row.opDetailList = []; row.opDetailList = [];
...@@ -615,17 +669,20 @@ export default { ...@@ -615,17 +669,20 @@ export default {
this.getCoreDetailList(row); this.getCoreDetailList(row);
} }
}, },
/**
* tab change
*/
tabChange() { tabChange() {
if ( if (
this.apiType === 'cpu' && this.apiType === 'cpu' &&
!this.cpuCharts.device_id !== this.currentCard.value this.cpuCharts.device_id !== this.currentCard.value
) { ) {
this.initOver = false; this.initOver = false;
this.clearCpuData(); this.clearCpuData();
this.getCpuList(); this.getCpuList();
} else if ( } else if (
this.apiType === 'core' && this.apiType === 'core' &&
!this.coreCharts.device_id !== this.currentCard.value this.coreCharts.device_id !== this.currentCard.value
) { ) {
this.initOver = false; this.initOver = false;
this.clearCoreData(); this.clearCoreData();
...@@ -635,17 +692,30 @@ export default { ...@@ -635,17 +692,30 @@ export default {
this.resizeCallback(); this.resizeCallback();
}); });
}, },
/**
* core table type change
*/
coreTableChange() { coreTableChange() {
if (this.statisticType === 1 && !this.opAllTypeList.opDetailCol.length) { if (this.statisticType === 1 && !this.opAllTypeList.opDetailCol.length) {
this.getCoreDetailList(this.opAllTypeList); this.getCoreDetailList(this.opAllTypeList);
} }
}, },
/**
* operator cpu chart change
*/
cpuChartChange() { cpuChartChange() {
this.setOption(this.cpuCharts); this.setOption(this.cpuCharts);
}, },
/**
* operator core chart change
*/
coreChartChange() { coreChartChange() {
this.setOption(this.coreCharts); this.setOption(this.coreCharts);
}, },
/**
* set chart option
* @param {Object} chart chart
*/
setOption(chart) { setOption(chart) {
const option = {}; const option = {};
if (chart.type === 0) { if (chart.type === 0) {
...@@ -743,7 +813,7 @@ export default { ...@@ -743,7 +813,7 @@ export default {
data: [], data: [],
}; };
option.grid = { option.grid = {
left: 30, left: 50,
top: 20, top: 20,
right: 0, right: 0,
bottom: 30, bottom: 30,
...@@ -777,6 +847,11 @@ export default { ...@@ -777,6 +847,11 @@ export default {
chart.chartDom.resize(); chart.chartDom.resize();
}, 10); }, 10);
}, },
/**
* show operator info deteail
* @param {Object} cellData cell data
* @param {Object} column column
*/
showInfoDetail(cellData, column) { showInfoDetail(cellData, column) {
if (column.property !== 'op_info' || !cellData || !cellData.op_info) { if (column.property !== 'op_info' || !cellData || !cellData.op_info) {
return; return;
...@@ -1041,9 +1116,9 @@ export default { ...@@ -1041,9 +1116,9 @@ export default {
position: relative; position: relative;
} }
td:first-child::before { td:first-child::before {
width: 20px; width: 42px;
background: #fff; background: #f0fdfd;
border-right: 3px solid #7693e1; border-right: 2px #00a5a7 solid;
z-index: 10; z-index: 10;
position: absolute; position: absolute;
left: 0; left: 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册