Skip to content

Commit

Permalink
feat: opt statis html,issue: TencentBlueKing#327
Browse files Browse the repository at this point in the history
  • Loading branch information
tomtian committed Dec 4, 2024
1 parent eb807ce commit 48e5e11
Showing 1 changed file with 39 additions and 4 deletions.
43 changes: 39 additions & 4 deletions src/backend/booster/bk_dist/dashboard/static/stats/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1177,11 +1177,22 @@ function initConcurrencyChart(target) {
}
let localPostData = calculate_concurrency(localPostList)

// 用最后的结束时间,模拟未执行完的任务的结束时间
let max_leave_time = 0
for (let i = 0; i < vue.jobs_data.length; i++) {
if (vue.jobs_data[i].leave_time > max_leave_time) {
max_leave_time = vue.jobs_data[i].leave_time
}
}
let localTotalList = []
for (let i = 0; i < vue.jobs_data.length; i++) {
localTotalList.push([vue.jobs_data[i].enter_time, vue.jobs_data[i].leave_time])
if (vue.jobs_data[i].leave_time > 0 ) {
localTotalList.push([vue.jobs_data[i].enter_time, vue.jobs_data[i].leave_time])
} else {
localTotalList.push([vue.jobs_data[i].enter_time, max_leave_time])
}
}
let localTotalData = calculate_concurrency(localTotalList)
let localTotalData = calculate_concurrency_instant(localTotalList)

let categories = []
let delta = (vue.work_data.end_time - vue.work_data.start_time) / line_scale
Expand Down Expand Up @@ -1307,9 +1318,20 @@ function initConcurrencyChartInstant(target) {
}
let localPostData = calculate_concurrency_instant(localPostList)

// 用最后的结束时间,模拟未执行完的任务的结束时间
let max_leave_time = 0
for (let i = 0; i < vue.jobs_data.length; i++) {
if (vue.jobs_data[i].leave_time > max_leave_time) {
max_leave_time = vue.jobs_data[i].leave_time
}
}
let localTotalList = []
for (let i = 0; i < vue.jobs_data.length; i++) {
localTotalList.push([vue.jobs_data[i].enter_time, vue.jobs_data[i].leave_time])
if (vue.jobs_data[i].leave_time > 0 ) {
localTotalList.push([vue.jobs_data[i].enter_time, vue.jobs_data[i].leave_time])
} else {
localTotalList.push([vue.jobs_data[i].enter_time, max_leave_time])
}
}
let localTotalData = calculate_concurrency_instant(localTotalList)

Expand Down Expand Up @@ -1387,6 +1409,7 @@ function initConcurrencyChartInstant(target) {
});
}

/*
function initConcurrencyChartInstant(target) {
let lockList = []
for (let i = 0; i < vue.jobs_data.length; i++) {
Expand Down Expand Up @@ -1430,9 +1453,20 @@ function initConcurrencyChartInstant(target) {
}
let localPostData = calculate_concurrency_instant(localPostList)
// 用最后的结束时间,模拟未执行完的任务的结束时间
let max_leave_time = 0
for (let i = 0; i < vue.jobs_data.length; i++) {
if (vue.jobs_data[i].leave_time > max_leave_time) {
max_leave_time = vue.jobs_data[i].leave_time
}
}
let localTotalList = []
for (let i = 0; i < vue.jobs_data.length; i++) {
localTotalList.push([vue.jobs_data[i].enter_time, vue.jobs_data[i].leave_time])
if (vue.jobs_data[i].leave_time > 0 ) {
localTotalList.push([vue.jobs_data[i].enter_time, vue.jobs_data[i].leave_time])
} else {
localTotalList.push([vue.jobs_data[i].enter_time, max_leave_time])
}
}
let localTotalData = calculate_concurrency_instant(localTotalList)
Expand Down Expand Up @@ -1509,6 +1543,7 @@ function initConcurrencyChartInstant(target) {
}
});
}
*/

function initSumChart(target) {
let processList = []
Expand Down

0 comments on commit 48e5e11

Please sign in to comment.