Browse Source

Merge pull request '资源占用情况显示-1的值修改为0' (#2277) from show-npu-metric into V20220616

Reviewed-on: https://git.openi.org.cn/OpenI/aiforge/pulls/2277
Reviewed-by: liuzx <liuzx@pcl.ac.cn>
pull/2290/head
liuzx 3 years ago
parent
commit
2f07b0e999
1 changed files with 2 additions and 3 deletions
  1. +2
    -3
      web_src/js/index.js

+ 2
- 3
web_src/js/index.js View File

@@ -5133,7 +5133,6 @@ function initChartsNpu() {
};
$('.metric_chart').click(function (e) {
let versionName = $(this).data('version')
console.log("11111", versionName)
let myCharts = echarts.init(document.getElementById(`metric-${versionName}`))
$.get(`${window.config.AppSubUrl}/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/metric_statistics?version_name=${versionName}&statistic_type=each`, (res) => {
let filterDta = res.MetricsInfo.filter((item) => {
@@ -5144,6 +5143,7 @@ function initChartsNpu() {
return item.metric
})
let seriesData = filterDta.map((item) => {
let value = item.value.map((item) => { return item > 0 ? item : '0' })
let seriesOption = {
name: item.metric,
type: 'line',
@@ -5157,12 +5157,11 @@ function initChartsNpu() {
shadowBlur: 10,
shadowOffsetY: 8
},
data: item.value
data: value
}
return seriesOption
})
let xLength = res.MetricsInfo[0].value.length
console.log(legenData)
options.xAxis.data = Array.from({ length: xLength }, (_, index) => index + 1)
options.legend.data = legenData
options.series = seriesData


Loading…
Cancel
Save