From 695b712f39fdba35829b808a590f3cbdceb39b42 Mon Sep 17 00:00:00 2001 From: lewis <747342561@qq.com> Date: Wed, 15 Jun 2022 11:23:28 +0800 Subject: [PATCH 1/2] add type=each --- modules/modelarts/resty.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/modelarts/resty.go b/modules/modelarts/resty.go index 961e02538..6a2803cb1 100755 --- a/modules/modelarts/resty.go +++ b/modules/modelarts/resty.go @@ -1131,7 +1131,7 @@ sendjob: res, err := client.R(). SetAuthToken(TOKEN). SetResult(&result). - Get(HOST + "/v1/" + setting.ProjectID + urlTrainJob + "/" + jobID + "/versions/" + versionID + "/pod/" + podName + "/metric-statistic") + Get(HOST + "/v1/" + setting.ProjectID + urlTrainJob + "/" + jobID + "/versions/" + versionID + "/pod/" + podName + "/metric-statistic?statistic_type=each") if err != nil { return nil, fmt.Errorf("resty GetTrainJobMetricStatistic: %v", err) From c0264c72a256c4f7e8523627dc661ed05fd209c3 Mon Sep 17 00:00:00 2001 From: zhoupzh Date: Wed, 15 Jun 2022 11:41:10 +0800 Subject: [PATCH 2/2] fix issue --- web_src/js/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web_src/js/index.js b/web_src/js/index.js index c7d77bdb4..ef12b4158 100755 --- a/web_src/js/index.js +++ b/web_src/js/index.js @@ -5093,8 +5093,9 @@ function initChartsNpu() { data: [] }, grid: { - top: '30%', + top: '35%', bottom: '2%', + x: '2%', containLabel: true }, tooltip: { @@ -5130,14 +5131,16 @@ function initChartsNpu() { series: [] }; + const sortBy = (arr, k) => arr.concat().sort((a, b) => (a[k] > b[k] ? 1 : a[k] < b[k] ? -1 : 0)); $('.metric_chart').click(function (e) { let versionName = $(this).data('version') 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) => { + $.get(`${window.config.AppSubUrl}/api/v1/repos/${userName}/${repoPath}/modelarts/train-job/${jobID}/metric_statistics?version_name=${versionName}&statistic_type=each&metrics=`, (res) => { let filterDta = res.MetricsInfo.filter((item) => { return !(['recvBytesRate', 'diskWriteRate', 'sendBytesRate', 'diskReadRate'].includes(item.metric)) }) + filterDta = sortBy(filterDta, "metric") let legenData = filterDta.map((item) => { return item.metric })