提交 c797ad86 编写于 作者: M mindspore-ci-bot 提交者: Gitee

!304 UI add profiling minddata page(3rd commit)

Merge pull request !304 from 潘慧/master_ph2
...@@ -360,7 +360,8 @@ ...@@ -360,7 +360,8 @@
"averageCapacity": "平均使用容量", "averageCapacity": "平均使用容量",
"stepTraceMessage": "当前FP和BP为自动选点,如不合乎预期,请自行修改。", "stepTraceMessage": "当前FP和BP为自动选点,如不合乎预期,请自行修改。",
"FPMessage": "FP起始算子:", "FPMessage": "FP起始算子:",
"BPMessage": "BP终止算子:" "BPMessage": "BP终止算子:",
"approximateTime": "总时长 ≈ "
}, },
"components": { "components": {
"summaryTitle": "训练选择", "summaryTitle": "训练选择",
......
...@@ -88,8 +88,8 @@ export default new Router({ ...@@ -88,8 +88,8 @@ export default new Router({
component: () => import('./views/train-manage/operator.vue'), component: () => import('./views/train-manage/operator.vue'),
}, },
{ {
path: 'minddata', path: 'data-process',
component: () => import('./views/train-manage/minddata.vue'), component: () => import('./views/train-manage/data-process.vue'),
}, },
], ],
}, },
......
...@@ -29,7 +29,7 @@ export default { ...@@ -29,7 +29,7 @@ export default {
queryLineagesData(params) { queryLineagesData(params) {
return axios({ return axios({
method: 'post', method: 'post',
url: '/v1/mindinsight/lineagemgr/lineages', url: 'v1/mindinsight/lineagemgr/lineages',
data: params.body, data: params.body,
}); });
}, },
...@@ -37,7 +37,7 @@ export default { ...@@ -37,7 +37,7 @@ export default {
putLineagesData(params) { putLineagesData(params) {
return axios({ return axios({
method: 'put', method: 'put',
url: '/v1/mindinsight/lineagemgr/lineages?train_id=' + params.train_id, url: 'v1/mindinsight/lineagemgr/lineages?train_id=' + params.train_id,
data: params.body, data: params.body,
}); });
}, },
...@@ -46,7 +46,7 @@ export default { ...@@ -46,7 +46,7 @@ export default {
querySummaryList(params, isIgnoreError) { querySummaryList(params, isIgnoreError) {
return axios({ return axios({
method: 'get', method: 'get',
url: '/v1/mindinsight/datavisual/train-jobs', url: 'v1/mindinsight/datavisual/train-jobs',
params: params, params: params,
headers: { headers: {
ignoreError: isIgnoreError, ignoreError: isIgnoreError,
...@@ -154,21 +154,21 @@ export default { ...@@ -154,21 +154,21 @@ export default {
getHistogramData(params) { getHistogramData(params) {
return axios({ return axios({
method: 'get', method: 'get',
url: '/v1/mindinsight/datavisual/histograms', url: 'v1/mindinsight/datavisual/histograms',
params: params, params: params,
}); });
}, },
getProfilerDeviceData(params) { getProfilerDeviceData(params) {
return axios({ return axios({
method: 'get', method: 'get',
url: '/v1/mindinsight/profile/devices', url: 'v1/mindinsight/profile/devices',
params: params, params: params,
}); });
}, },
getProfilerOpData(params) { getProfilerOpData(params) {
return axios({ return axios({
method: 'post', method: 'post',
url: '/v1/mindinsight/profile/ops/search', url: 'v1/mindinsight/profile/ops/search',
params: params.params, params: params.params,
data: params.body, data: params.body,
headers: { headers: {
...@@ -180,7 +180,7 @@ export default { ...@@ -180,7 +180,7 @@ export default {
queryDataOfProfileHelper(params) { queryDataOfProfileHelper(params) {
return axios({ return axios({
method: 'get', method: 'get',
url: '/v1/mindinsight/profile/summary/propose', url: 'v1/mindinsight/profile/summary/propose',
params: params, params: params,
}); });
}, },
...@@ -188,7 +188,7 @@ export default { ...@@ -188,7 +188,7 @@ export default {
queryTrainingTrace(params) { queryTrainingTrace(params) {
return axios({ return axios({
method: 'get', method: 'get',
url: '/v1/mindinsight/profile/training-trace/graph', url: 'v1/mindinsight/profile/training-trace/graph',
params: params, params: params,
headers: { headers: {
ignoreError: true, ignoreError: true,
...@@ -198,7 +198,7 @@ export default { ...@@ -198,7 +198,7 @@ export default {
targetTimeInfo(params) { targetTimeInfo(params) {
return axios({ return axios({
method: 'get', method: 'get',
url: '/v1/mindinsight/profile/training-trace/target-time-info', url: 'v1/mindinsight/profile/training-trace/target-time-info',
params: params, params: params,
headers: { headers: {
ignoreError: true, ignoreError: true,
...@@ -208,7 +208,7 @@ export default { ...@@ -208,7 +208,7 @@ export default {
queryTimeline(params) { queryTimeline(params) {
return axios({ return axios({
method: 'get', method: 'get',
url: '/v1/mindinsight/profile/timeline', url: 'v1/mindinsight/profile/timeline',
params: params, params: params,
headers: { headers: {
ignoreError: true, ignoreError: true,
......
<!-- <!--
Copyright 2019 Huawei Technologies Co., Ltd.All Rights Reserved. Copyright 2020 Huawei Technologies Co., Ltd.All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License"); Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. you may not use this file except in compliance with the License.
...@@ -373,7 +373,7 @@ export default { ...@@ -373,7 +373,7 @@ export default {
allGraphData: {}, allGraphData: {},
graphviz: null, graphviz: null,
totalMemory: 16777216 * 2, // Memory size of the graph plug-in totalMemory: 16777216 * 2, // Memory size of the graph plug-in
scaleRange: [1, 10000], // graph zooms in and zooms out. scaleRange: [0.0001, 10000], // graph zooms in and zooms out.
initQueue: '', initQueue: '',
trainId: '', trainId: '',
selected: '', selected: '',
...@@ -386,13 +386,13 @@ export default { ...@@ -386,13 +386,13 @@ export default {
this.dir = newValue.query.dir; this.dir = newValue.query.dir;
this.trainId = newValue.query.id; this.trainId = newValue.query.id;
this.currentCard = newValue.curCardNum; this.currentCard = newValue.curCardNum;
if (this.trainingJobId) { if (this.trainId) {
document.title = document.title =
`${decodeURIComponent(this.trainingJobId)}` + `${decodeURIComponent(this.trainId)}` +
`-${this.$t('profiling.profilingDashboard')}-MindInsight`; `-${this.$t('profiling.mindData')}-MindInsight`;
} else { } else {
document.title = `${this.$t( document.title = `${this.$t(
'profiling.profilingDashboard', 'profiling.mindData',
)}-MindInsight`; )}-MindInsight`;
} }
if (this.activeName === 'queueInfo') { if (this.activeName === 'queueInfo') {
...@@ -422,6 +422,7 @@ export default { ...@@ -422,6 +422,7 @@ export default {
}); });
} }
} }
this.resizeCallback();
}, },
init() { init() {
this.queryQueueInfo(this.connectQueueChart); this.queryQueueInfo(this.connectQueueChart);
...@@ -1024,41 +1025,81 @@ export default { ...@@ -1024,41 +1025,81 @@ export default {
* Initializing the Zoom Function of a Graph * Initializing the Zoom Function of a Graph
*/ */
initZooming() { initZooming() {
const graphDom = document.querySelector('#graph0'); const svgDom = document.querySelector('#graph svg');
const svgRect = svgDom.getBoundingClientRect();
const graphDom = document.querySelector('#graph #graph0');
const graphBox = graphDom.getBBox(); const graphBox = graphDom.getBBox();
const graphRect = graphDom.getBoundingClientRect();
let graphTransform = {};
const minScale = Math.min(
svgRect.width / 2 / graphRect.width,
svgRect.height / 2 / graphRect.height,
);
const padding = 4; const padding = 4;
const pointer = { const minDistance = 20;
start: { const pointer = {start: {x: 0, y: 0}, end: {x: 0, y: 0}};
x: 0,
y: 0,
},
end: {
x: 0,
y: 0,
},
};
const zoom = d3 const zoom = d3
.zoom() .zoom()
.on('start', (target) => { .on('start', () => {
pointer.start.x = event.x; pointer.start.x = event.x;
pointer.start.y = event.y; pointer.start.y = event.y;
}) })
.on('zoom', (target) => { .on('zoom', () => {
const transformData = this.getTransformData(graphDom); const transformData = this.getTransformData(graphDom);
if (!Object.keys(graphTransform).length) {
graphTransform = {
x: transformData.translate[0],
y: transformData.translate[1],
k: transformData.scale[0],
};
}
let tempStr = ''; let tempStr = '';
let change = {}; let change = {};
let scale = transformData.scale[0]; let scale = transformData.scale[0];
const graphRect = graphDom.getBoundingClientRect(); const graphRect = graphDom.getBoundingClientRect();
const mapping = { const transRate = graphBox.width / graphRect.width;
width: graphBox.width / graphRect.width,
height: graphBox.height / graphRect.height,
};
if (event.type === 'mousemove') { if (event.type === 'mousemove') {
pointer.end.x = event.x; pointer.end.x = event.x;
pointer.end.y = event.y; pointer.end.y = event.y;
let tempX = pointer.end.x - pointer.start.x;
let tempY = pointer.end.y - pointer.start.y;
const paddingTrans = Math.max(
(padding / transRate) * scale,
minDistance,
);
if (
graphRect.left + paddingTrans + tempX >=
svgRect.left + svgRect.width
) {
tempX = Math.min(tempX, 0);
}
if (
graphRect.left + graphRect.width - paddingTrans + tempX <=
svgRect.left
) {
tempX = Math.max(tempX, 0);
}
if (
graphRect.top + paddingTrans + tempY >=
svgRect.top + svgRect.height
) {
tempY = Math.min(tempY, 0);
}
if (
graphRect.top + graphRect.height - paddingTrans + tempY <=
svgRect.top
) {
tempY = Math.max(tempY, 0);
}
change = { change = {
x: (pointer.end.x - pointer.start.x) * mapping.width * scale, x: tempX * transRate * scale,
y: (pointer.end.y - pointer.start.y) * mapping.height * scale, y: tempY * transRate * scale,
}; };
pointer.start.x = pointer.end.x; pointer.start.x = pointer.end.x;
pointer.start.y = pointer.end.y; pointer.start.y = pointer.end.y;
...@@ -1069,29 +1110,42 @@ export default { ...@@ -1069,29 +1110,42 @@ export default {
wheelDelta > 0 wheelDelta > 0
? transformData.scale[0] * rate ? transformData.scale[0] * rate
: transformData.scale[0] / rate; : transformData.scale[0] / rate;
scale = Math.max(this.scaleRange[0], scale);
scale = Math.max(this.scaleRange[0], scale, minScale);
scale = Math.min(this.scaleRange[1], scale); scale = Math.min(this.scaleRange[1], scale);
change = { change = {
x: x:
(graphRect.x + padding / mapping.width - event.x) * (graphRect.x + padding / transRate - event.x) *
mapping.width * transRate *
(scale - transformData.scale[0]), (scale - transformData.scale[0]),
y: y:
(graphRect.bottom - padding / mapping.height - event.y) * (graphRect.bottom - padding / transRate - event.y) *
mapping.height * transRate *
(scale - transformData.scale[0]), (scale - transformData.scale[0]),
}; };
} }
tempStr = `translate(${transformData.translate[0] +
change.x},${transformData.translate[1] + graphTransform = {
change.y}) scale(${scale})`; x: transformData.translate[0] + change.x,
y: transformData.translate[1] + change.y,
k: scale,
};
tempStr = `translate(${graphTransform.x},${graphTransform.y}) scale(${graphTransform.k})`;
graphDom.setAttribute('transform', tempStr); graphDom.setAttribute('transform', tempStr);
event.stopPropagation();
event.preventDefault();
}); });
const svg = d3.select('svg'); const svg = d3.select('#graph svg');
svg.on('.zoom', null); svg.on('.zoom', null);
svg.call(zoom); svg.call(zoom);
svg.on('dblclick.zoom', null); svg.on('dblclick.zoom', null);
svg.on('wheel.zoom', null);
const graph0 = d3.select('#graph #graph0');
graph0.on('.zoom', null);
graph0.call(zoom);
}, },
/** /**
* Obtains the transform data of a node. * Obtains the transform data of a node.
...@@ -1259,7 +1313,6 @@ export default { ...@@ -1259,7 +1313,6 @@ export default {
&:last-child { &:last-child {
height: 50%; height: 50%;
} }
height: 50%;
& > .title { & > .title {
margin-bottom: 15px; margin-bottom: 15px;
font-weight: bold; font-weight: bold;
...@@ -1270,7 +1323,7 @@ export default { ...@@ -1270,7 +1323,7 @@ export default {
.chart-wrap { .chart-wrap {
float: left; float: left;
width: calc(50% - 12px); width: calc(50% - 12px);
height: 100%; height: calc(100% - 10px);
border-radius: 4px; border-radius: 4px;
overflow-y: auto; overflow-y: auto;
border: 1px solid #eee; border: 1px solid #eee;
......
...@@ -165,8 +165,8 @@ ...@@ -165,8 +165,8 @@
{{ $t('operator.operatorStatistics') }} {{ $t('operator.operatorStatistics') }}
</span> </span>
<div class="cl-search-box"> <div class="cl-search-box">
<el-input v-model="searchByCPUNameInput" <el-input v-model="searchByCPUTypeInput"
:placeholder="$t('operator.searchByName')" :placeholder="$t('operator.searchByType')"
clearable clearable
@clear="searchOpCpuList()" @clear="searchOpCpuList()"
@keyup.enter.native="searchOpCpuList()"></el-input> @keyup.enter.native="searchOpCpuList()"></el-input>
...@@ -256,7 +256,7 @@ export default { ...@@ -256,7 +256,7 @@ export default {
statisticType: 0, // ai core table statistic type statisticType: 0, // ai core table statistic type
searchByTypeInput: '', // search by ai core type name searchByTypeInput: '', // search by ai core type name
searchByNameInput: '', // search by ai core detail name searchByNameInput: '', // search by ai core detail name
searchByCPUNameInput: '', // search by ai cpu name searchByCPUTypeInput: '', // search by ai cpu name
opTypeCol: [], // table headers list of operator type opTypeCol: [], // table headers list of operator type
opTypeList: [], // table list of operator type opTypeList: [], // table list of operator type
opCpuList: { opCpuList: {
...@@ -310,7 +310,7 @@ export default { ...@@ -310,7 +310,7 @@ export default {
this.profile_dir = newValue.query.dir; this.profile_dir = newValue.query.dir;
this.train_id = newValue.query.id; this.train_id = newValue.query.id;
this.currentCard = newValue.curCardNum; this.currentCard = newValue.curCardNum;
this.init(); this.cardChange();
} }
}, },
deep: true, deep: true,
...@@ -323,9 +323,6 @@ export default { ...@@ -323,9 +323,6 @@ export default {
this.$bus.$off('collapse'); this.$bus.$off('collapse');
}, },
methods: { methods: {
init() {
this.getCoreTypeList();
},
resizeEchart() { resizeEchart() {
if (this.coreCharts.chartDom) { if (this.coreCharts.chartDom) {
setTimeout(() => { setTimeout(() => {
...@@ -343,7 +340,7 @@ export default { ...@@ -343,7 +340,7 @@ export default {
this.getCoreTypeList(); this.getCoreTypeList();
} else if (this.apiType === 'cpu') { } else if (this.apiType === 'cpu') {
this.clearCpuData(); this.clearCpuData();
this.getCpuList(true); this.getCpuList();
} }
}, },
opTypeSortChange() { opTypeSortChange() {
...@@ -358,7 +355,7 @@ export default { ...@@ -358,7 +355,7 @@ export default {
* clear cpu data * clear cpu data
*/ */
clearCpuData() { clearCpuData() {
this.searchByCPUNameInput = ''; this.searchByCPUTypeInput = '';
this.opCpuList = { this.opCpuList = {
opDetailCol: [], opDetailCol: [],
opDetailList: [], opDetailList: [],
...@@ -635,9 +632,9 @@ export default { ...@@ -635,9 +632,9 @@ export default {
*/ */
searchOpCpuList() { searchOpCpuList() {
this.opCpuList.op_filter_condition = {}; this.opCpuList.op_filter_condition = {};
if (this.searchByCPUNameInput) { if (this.searchByCPUTypeInput) {
this.opCpuList.op_filter_condition = { this.opCpuList.op_filter_condition = {
op_name: {partial_match_str_in: [this.searchByCPUNameInput]}, op_type: {partial_match_str_in: [this.searchByCPUTypeInput]},
}; };
} else { } else {
this.opCpuList.op_filter_condition = {}; this.opCpuList.op_filter_condition = {};
......
...@@ -46,7 +46,9 @@ limitations under the License. ...@@ -46,7 +46,9 @@ limitations under the License.
</div> </div>
<br /> <br />
<div>{{$t('profiling.statistics')}}</div> <div>{{$t('profiling.statistics')}}</div>
<div>{{$t('profiling.totalTime')}}<span>{{totalTime}}{{$t('profiling.millisecond')}}</span></div> <div>{{$t('profiling.totalTime')}}
<span>{{totalTime}}{{$t('profiling.millisecond')}}</span>
</div>
<div>{{$t('profiling.totalSteps')}}<span>{{totalSteps}}</span></div> <div>{{$t('profiling.totalSteps')}}<span>{{totalSteps}}</span></div>
<div>{{$t('profiling.fpbpTimeRatio')}}<span>{{fpAndBp}}</span></div> <div>{{$t('profiling.fpbpTimeRatio')}}<span>{{fpAndBp}}</span></div>
<div>{{$t('profiling.iterationGapTimeRatio')}}<span>{{iterationInterval}}</span></div> <div>{{$t('profiling.iterationGapTimeRatio')}}<span>{{iterationInterval}}</span></div>
...@@ -101,7 +103,7 @@ limitations under the License. ...@@ -101,7 +103,7 @@ limitations under the License.
<div class="title-wrap"> <div class="title-wrap">
<div class="title">{{ $t('profiling.mindData') }}</div> <div class="title">{{ $t('profiling.mindData') }}</div>
<div class="view-detail"> <div class="view-detail">
<button @click="viewDetail('minddata')" <button @click="viewDetail('data-process')"
:disabled="processSummary.noData" :disabled="processSummary.noData"
:class="{disabled:processSummary.noData}"> :class="{disabled:processSummary.noData}">
{{ $t('profiling.viewDetail') }} {{ $t('profiling.viewDetail') }}
...@@ -117,18 +119,18 @@ limitations under the License. ...@@ -117,18 +119,18 @@ limitations under the License.
<div>{{$t('profiling.dataProcessInfo')}}</div> <div>{{$t('profiling.dataProcessInfo')}}</div>
<div>{{$t('profiling.analysisOne')}}</div> <div>{{$t('profiling.analysisOne')}}</div>
<div>{{$t('profiling.analysisTwo')}}</div> <div>{{$t('profiling.analysisTwo')}}</div>
<div v-show="deviceInfoShow||queueInfoShow">{{$t('profiling.higherAnalysis')}}</div> <div v-show="deviceInfoShow || queueInfoShow">{{$t('profiling.higherAnalysis')}}</div>
<br /> <br />
<div v-show="deviceInfoShow||queueInfoShow">{{$t('profiling.statistics')}}</div> <div v-show="deviceInfoShow || queueInfoShow">{{$t('profiling.statistics')}}</div>
<div v-show="queueInfoShow">{{$t('profiling.chipInfo')}} <div v-show="queueInfoShow">{{$t('profiling.chipInfo')}}
<span>{{queueInfoEmptyNum}}/{{queueInfoTotalNum}}</span> <span>{{queueInfoEmptyNum}} / {{queueInfoTotalNum}}</span>
</div> </div>
<div v-show="deviceInfoShow"> <div v-show="deviceInfoShow">
<div>{{$t('profiling.hostIsEmpty')}} <div>{{$t('profiling.hostIsEmpty')}}
<span>{{deviceInfoEmptyNum}}/{{deviceInfoTotalNum}}</span> <span>{{deviceInfoEmptyNum}} / {{deviceInfoTotalNum}}</span>
</div> </div>
<div>{{$t('profiling.hostIsFull')}} <div>{{$t('profiling.hostIsFull')}}
<span>{{deviceInfoFullNum}}/{{deviceInfoTotalNum}}</span> <span>{{deviceInfoFullNum}} / {{deviceInfoTotalNum}}</span>
</div> </div>
</div> </div>
</div> </div>
...@@ -162,18 +164,19 @@ limitations under the License. ...@@ -162,18 +164,19 @@ limitations under the License.
</div> </div>
<div class="title">{{$t('profiling.connectorQuene')}}</div> <div class="title">{{$t('profiling.connectorQuene')}}</div>
<div class="description"> <div class="description">
<div class="line"></div>
<div class="item" <div class="item"
v-if="processSummary.device.empty || processSummary.device.empty === 0"> v-if="processSummary.device.empty || processSummary.device.empty === 0">
{{$t('profiling.queueTip2')}} {{$t('profiling.queueTip2')}}
<span class="num"> <span class="num">
{{processSummary.device.empty}}/{{processSummary.device.total}} {{processSummary.device.empty}} / {{processSummary.device.total}}
</span> </span>
</div> </div>
<div class="item" <div class="item"
v-if="processSummary.device.full || processSummary.device.full === 0"> v-if="processSummary.device.full || processSummary.device.full === 0">
{{$t('profiling.queueTip1')}} {{$t('profiling.queueTip1')}}
<span class="num"> <span class="num">
{{processSummary.device.empty}}/{{processSummary.device.total}} {{processSummary.device.empty}} / {{processSummary.device.total}}
</span> </span>
</div> </div>
</div> </div>
...@@ -206,18 +209,19 @@ limitations under the License. ...@@ -206,18 +209,19 @@ limitations under the License.
</div> </div>
<div class="title">{{$t('profiling.dataQueue')}}</div> <div class="title">{{$t('profiling.dataQueue')}}</div>
<div class="description"> <div class="description">
<div class="line"></div>
<div class="item" <div class="item"
v-if="processSummary.get_next.empty || processSummary.get_next.empty === 0"> v-if="processSummary.get_next.empty || processSummary.get_next.empty === 0">
{{$t('profiling.queueTip2')}} {{$t('profiling.queueTip2')}}
<span class="num"> <span class="num">
{{processSummary.get_next.empty}}/{{processSummary.get_next.total}} {{processSummary.get_next.empty}} / {{processSummary.get_next.total}}
</span> </span>
</div> </div>
<div class="item" <div class="item"
v-if="processSummary.get_next.full || processSummary.get_next.full === 0"> v-if="processSummary.get_next.full || processSummary.get_next.full === 0">
{{$t('profiling.queueTip1')}} {{$t('profiling.queueTip1')}}
<span class="num"> <span class="num">
{{processSummary.get_next.empty}}/{{processSummary.get_next.total}} {{processSummary.get_next.empty}} / {{processSummary.get_next.total}}
</span> </span>
</div> </div>
</div> </div>
...@@ -451,8 +455,7 @@ export default { ...@@ -451,8 +455,7 @@ export default {
const data = JSON.parse(JSON.stringify(resp.data)); const data = JSON.parse(JSON.stringify(resp.data));
this.processSummary.count = Object.keys(data).length; this.processSummary.count = Object.keys(data).length;
this.dealProcess(data); this.dealProcess(data);
// Chip side
// 芯片侧
if (resp.data.get_next_queue_info) { if (resp.data.get_next_queue_info) {
this.queueInfoShow = true; this.queueInfoShow = true;
this.queueInfoEmptyNum = this.queueInfoEmptyNum =
...@@ -460,7 +463,7 @@ export default { ...@@ -460,7 +463,7 @@ export default {
this.queueInfoTotalNum = this.queueInfoTotalNum =
resp.data.get_next_queue_info.summary.total_batch; resp.data.get_next_queue_info.summary.total_batch;
} }
// 主机侧 // Host side
if (resp.data.device_queue_info) { if (resp.data.device_queue_info) {
this.deviceInfoShow = true; this.deviceInfoShow = true;
this.deviceInfoEmptyNum = this.deviceInfoEmptyNum =
...@@ -498,13 +501,14 @@ export default { ...@@ -498,13 +501,14 @@ export default {
option.series = [ option.series = [
{ {
type: 'pie', type: 'pie',
center: ['55%', '55%'], center: ['50%', '50%'],
data: this.pieChart.data, data: this.pieChart.data,
radius: '50%', radius: '80%',
lable: { label: {
position: 'outer', normal: {
alignTo: 'none', show: false,
bleedMargin: 5, positionL: 'inner',
},
}, },
itemStyle: { itemStyle: {
normal: { normal: {
...@@ -550,7 +554,7 @@ export default { ...@@ -550,7 +554,7 @@ export default {
if (res.data.object) { if (res.data.object) {
this.pieChart.data = []; this.pieChart.data = [];
res.data.object.forEach((item) => { res.data.object.forEach((item) => {
if (this.pieChart.data && this.pieChart.data.length < 19) { if (this.pieChart.data && this.pieChart.data.length < 5) {
this.pieChart.data.push({ this.pieChart.data.push({
name: item[0], name: item[0],
value: item[1], value: item[1],
...@@ -558,15 +562,15 @@ export default { ...@@ -558,15 +562,15 @@ export default {
percent: item[3], percent: item[3],
}); });
} else { } else {
if (!this.pieChart.data[19]) { if (!this.pieChart.data[5]) {
this.pieChart.data[19] = { this.pieChart.data[5] = {
name: 'Other', name: 'Other',
value: 0, value: 0,
percent: 0, percent: 0,
}; };
} }
this.pieChart.data[19].value += item[1]; this.pieChart.data[5].value += item[1];
this.pieChart.data[19].percent += item[3]; this.pieChart.data[5].percent += item[3];
} }
}); });
this.setPieOption(); this.setPieOption();
...@@ -751,7 +755,9 @@ export default { ...@@ -751,7 +755,9 @@ export default {
line.setAttribute('marker-start', 'url(#marker_start)'); line.setAttribute('marker-start', 'url(#marker_start)');
const text = document.createElementNS(this.svg.namespaceURI, 'text'); const text = document.createElementNS(this.svg.namespaceURI, 'text');
text.textContent = `${data.duration.toFixed(4)}ms`; text.textContent = `${
rowIndex === 0 ? this.$t('profiling.approximateTime') : ''
}${data.duration.toFixed(4)}ms`;
const textWidth = this.getTextWidth(text.textContent); const textWidth = this.getTextWidth(text.textContent);
text.setAttribute( text.setAttribute(
'x', 'x',
...@@ -884,7 +890,7 @@ export default { ...@@ -884,7 +890,7 @@ export default {
}; };
this.processSummary.noData = true; this.processSummary.noData = true;
if (data) { if (data && Object.keys(data).length) {
if (data.device_queue_info && data.device_queue_info.summary) { if (data.device_queue_info && data.device_queue_info.summary) {
this.processSummary.device = { this.processSummary.device = {
empty: data.device_queue_info.summary.empty_batch_count, empty: data.device_queue_info.summary.empty_batch_count,
...@@ -1089,6 +1095,13 @@ export default { ...@@ -1089,6 +1095,13 @@ export default {
overflow: hidden; overflow: hidden;
width: 100%; width: 100%;
text-align: center; text-align: center;
.line {
width: 1px;
height: 40px;
margin: 20px 0;
border-left: 1px solid #979797;
display: inline-block;
}
.item { .item {
font-size: 12px; font-size: 12px;
line-height: 16px; line-height: 16px;
......
...@@ -186,10 +186,22 @@ export default { ...@@ -186,10 +186,22 @@ export default {
const divDom = document.createElement('div'); const divDom = document.createElement('div');
divDom.setAttribute('class', 'content-style'); divDom.setAttribute('class', 'content-style');
const content = `${this.$t(`profiling`)[item].desc}` const content = `${this.$t(`profiling`)[item].desc}`
.replace(`{n1}`, deviceEmpty) .replace(
.replace(`{n2}`, deviceTotal) `{n1}`,
.replace(`{n3}`, deviceFull) `<span class="nowrap-style"> ${deviceEmpty}</span>`,
.replace(`{n4}`, deviceTotal); )
.replace(
`{n2}`,
`<span class="nowrap-style"> ${deviceTotal}</span>`,
)
.replace(
`{n3}`,
`<span class="nowrap-style"> ${deviceFull}</span>`,
)
.replace(
`{n4}`,
`<span class="nowrap-style"> ${deviceTotal}</span>`,
);
divDom.innerHTML = `<div class="content-icon el-icon-caret-right"></div> divDom.innerHTML = `<div class="content-icon el-icon-caret-right"></div>
<div class="helper-content-style">${content}</div>`; <div class="helper-content-style">${content}</div>`;
helperDiv.appendChild(divDom); helperDiv.appendChild(divDom);
...@@ -205,8 +217,14 @@ export default { ...@@ -205,8 +217,14 @@ export default {
const divDom = document.createElement('div'); const divDom = document.createElement('div');
divDom.setAttribute('class', 'content-style'); divDom.setAttribute('class', 'content-style');
const content = `${this.$t(`profiling`)[item].desc}` const content = `${this.$t(`profiling`)[item].desc}`
.replace(`{n1}`, getNextEmpty) .replace(
.replace(`{n2}`, getNextTotal); `{n1}`,
`<span class="nowrap-style"> ${getNextEmpty}</span>`,
)
.replace(
`{n2}`,
`<span class="nowrap-style"> ${getNextTotal}</span>`,
);
divDom.innerHTML = `<div class="content-icon el-icon-caret-right"></div> divDom.innerHTML = `<div class="content-icon el-icon-caret-right"></div>
<div class="helper-content-style">${content}</div>`; <div class="helper-content-style">${content}</div>`;
helperDiv.appendChild(divDom); helperDiv.appendChild(divDom);
...@@ -216,7 +234,7 @@ export default { ...@@ -216,7 +234,7 @@ export default {
divDom.setAttribute('class', 'content-style'); divDom.setAttribute('class', 'content-style');
divDom.innerHTML = `<div class="content-icon el-icon-caret-right"></div> divDom.innerHTML = `<div class="content-icon el-icon-caret-right"></div>
<div class="helper-content-style"> <div class="helper-content-style">
<a href="${this.$t(`profiling`)[item].url[0]}"> <a target="_blank" href="${this.$t(`profiling`)[item].url[0]}">
${this.$t(`profiling`)[item].desc}</a></div>`; ${this.$t(`profiling`)[item].desc}</a></div>`;
helperDiv.appendChild(divDom); helperDiv.appendChild(divDom);
} else { } else {
...@@ -227,7 +245,7 @@ export default { ...@@ -227,7 +245,7 @@ export default {
for (let i = 0; i < anchorList.length; i++) { for (let i = 0; i < anchorList.length; i++) {
const desc = anchorContent.relpace( const desc = anchorContent.relpace(
anchorList[i], anchorList[i],
`<a href="${this.$t(`profiling`)[item].url[i]}"> `<a target="_blank" href="${this.$t(`profiling`)[item].url[i]}">
${anchorList[i]}</a>`, ${anchorList[i]}</a>`,
); );
anchorContent = desc; anchorContent = desc;
...@@ -288,8 +306,13 @@ export default { ...@@ -288,8 +306,13 @@ export default {
.helper { .helper {
padding: 32px; padding: 32px;
height: 100%; height: 100%;
overflow-y: auto;
margin-left: 32px; margin-left: 32px;
background: #edf0f5; background: #edf0f5;
word-wrap: break-word;
.nowrap-style{
white-space: nowrap;
}
.cur-card { .cur-card {
margin-bottom: 32px; margin-bottom: 32px;
.card-select { .card-select {
......
...@@ -32,6 +32,11 @@ limitations under the License. ...@@ -32,6 +32,11 @@ limitations under the License.
</div> </div>
</div> </div>
</div> </div>
<div class="step-message">
<div class="step-padding-right">{{$t('profiling.stepTraceMessage')}}</div>
<div class="step-padding-right">{{$t('profiling.FPMessage')}}<span>{{fp_start}}</span></div>
<div class="step-padding-right">{{$t('profiling.BPMessage')}}<span>{{bp_end}}</span></div>
</div>
<div class="pf-content-middle" <div class="pf-content-middle"
v-show="!tabsArr[0].noData && !tabsArr[1].noData && !tabsArr[2].noData && !svg.noData"> v-show="!tabsArr[0].noData && !tabsArr[1].noData && !tabsArr[2].noData && !svg.noData">
<div id="trace-container"> <div id="trace-container">
...@@ -84,11 +89,11 @@ limitations under the License. ...@@ -84,11 +89,11 @@ limitations under the License.
class="chart-wrap"> class="chart-wrap">
<div class="title">{{ item.name }}</div> <div class="title">{{ item.name }}</div>
<div class="rate-wrap"> <div class="rate-wrap">
<div v-if="item.timeSummary.total_time !== undefined && item.timeSummary[item.rate] !== undefined">
<span>{{item.timeLabel}}:</span>
{{(item.timeSummary.total_time*parseFloat(item.timeSummary[item.rate])/100).toFixed(4)}}ms</div>
<div v-if="item.timeSummary[item.rate] !== undefined"> <div v-if="item.timeSummary[item.rate] !== undefined">
<span>{{item.rateLabel}}:</span>{{item.timeSummary[item.rate]}}</div> <span>{{item.timeLabel}}:</span>
{{item.timeSummary[item.rate]}}ms</div>
<div v-if="item.timeSummary[item.percent] !== undefined">
<span>{{item.rateLabel}}:</span>{{item.timeSummary[item.percent]}}</div>
<div v-if="item.timeSummary.total_steps !== undefined"> <div v-if="item.timeSummary.total_steps !== undefined">
<span>{{$t('profiling.stepNum')}}:</span>{{item.timeSummary.total_steps}}</div> <span>{{$t('profiling.stepNum')}}:</span>{{item.timeSummary.total_steps}}</div>
</div> </div>
...@@ -125,6 +130,8 @@ export default { ...@@ -125,6 +130,8 @@ export default {
dir: this.$route.query.dir, dir: this.$route.query.dir,
train_id: this.$route.query.id, train_id: this.$route.query.id,
relativePath: this.$route.query.path, relativePath: this.$route.query.path,
fp_start: '--',
bp_end: '--',
steps: [], steps: [],
selectedStep: '', selectedStep: '',
charts: [], charts: [],
...@@ -157,6 +164,7 @@ export default { ...@@ -157,6 +164,7 @@ export default {
timeLabel: this.$t('profiling.iterGapTimeLabel'), timeLabel: this.$t('profiling.iterGapTimeLabel'),
rateLabel: this.$t('profiling.iterGapRateLabel'), rateLabel: this.$t('profiling.iterGapRateLabel'),
noData: false, noData: false,
percent: 'iteration_interval_percent',
}, },
{ {
name: 'Fp+bp', name: 'Fp+bp',
...@@ -166,6 +174,7 @@ export default { ...@@ -166,6 +174,7 @@ export default {
timeLabel: this.$t('profiling.fpBpTimeLabel'), timeLabel: this.$t('profiling.fpBpTimeLabel'),
rateLabel: this.$t('profiling.fpBpRateLabel'), rateLabel: this.$t('profiling.fpBpRateLabel'),
noData: false, noData: false,
percent: 'fp_and_bp_percent',
}, },
{ {
name: this.$t('profiling.lterationTail'), name: this.$t('profiling.lterationTail'),
...@@ -175,6 +184,7 @@ export default { ...@@ -175,6 +184,7 @@ export default {
timeLabel: this.$t('profiling.tailTimeLabel'), timeLabel: this.$t('profiling.tailTimeLabel'),
rateLabel: this.$t('profiling.tailRateLabel'), rateLabel: this.$t('profiling.tailRateLabel'),
noData: false, noData: false,
percent: 'tail_percent',
}, },
], ],
}; };
...@@ -348,7 +358,7 @@ export default { ...@@ -348,7 +358,7 @@ export default {
}, },
resizeEchart() { resizeEchart() {
setTimeout(() => { setTimeout(() => {
this.charts.forEach((val)=>{ this.charts.forEach((val) => {
val.resize(); val.resize();
}); });
}, 300); }, 300);
...@@ -367,6 +377,13 @@ export default { ...@@ -367,6 +377,13 @@ export default {
res.data.training_trace_graph.length res.data.training_trace_graph.length
) { ) {
this.svg.noData = false; this.svg.noData = false;
if (res.data.point_info && res.data.point_info.length) {
this.fp_start = res.data.point_info.fp_start;
this.bp_end = res.data.point_info.bp_end;
} else {
this.fp_start = '--';
this.bp_end = '--';
}
document.querySelector('#trace').style.height = `${res.data document.querySelector('#trace').style.height = `${res.data
.training_trace_graph.length * this.svg.rowHeight}px`; .training_trace_graph.length * this.svg.rowHeight}px`;
this.svg.data = JSON.parse( this.svg.data = JSON.parse(
...@@ -377,12 +394,16 @@ export default { ...@@ -377,12 +394,16 @@ export default {
this.dealTraceData(); this.dealTraceData();
}, 100); }, 100);
} else { } else {
this.fp_start = '--';
this.bp_end = '--';
this.svg.data = []; this.svg.data = [];
this.svg.noData = true; this.svg.noData = true;
this.removeTrace(); this.removeTrace();
} }
}, },
(error) => { (error) => {
this.fp_start = '--';
this.bp_end = '--';
this.svg.data = []; this.svg.data = [];
this.svg.noData = true; this.svg.noData = true;
this.removeTrace(); this.removeTrace();
...@@ -498,7 +519,9 @@ export default { ...@@ -498,7 +519,9 @@ export default {
line.setAttribute('marker-start', 'url(#marker_start)'); line.setAttribute('marker-start', 'url(#marker_start)');
const text = document.createElementNS(this.svg.namespaceURI, 'text'); const text = document.createElementNS(this.svg.namespaceURI, 'text');
text.textContent = `${data.duration.toFixed(4)}ms`; text.textContent = `${
rowIndex === 0 ? this.$t('profiling.approximateTime') : ''
}${data.duration.toFixed(4)}ms`;
const textWidth = this.getTextWidth(text.textContent); const textWidth = this.getTextWidth(text.textContent);
text.setAttribute( text.setAttribute(
'x', 'x',
...@@ -599,9 +622,20 @@ export default { ...@@ -599,9 +622,20 @@ export default {
font-weight: normal; font-weight: normal;
} }
} }
.step-message {
display: flex;
height: 24px;
line-height: 24px;
margin-top: 6px;
margin-left: 14px;
overflow-y: auto;
}
.step-padding-right {
padding-right: 6px;
}
.pf-content-middle { .pf-content-middle {
padding: 15px 15px 0; padding: 15px 15px 0;
height: calc(100% - 32px); height: calc(100% - 62px);
#trace-container { #trace-container {
width: 100%; width: 100%;
height: 50%; height: 50%;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册