能力云图-总调用次数

This commit is contained in:
851673013@qq.com 2022-08-04 16:52:08 +08:00
parent f2b714a915
commit eafd6aea19
2 changed files with 10 additions and 7 deletions

View File

@ -97,7 +97,7 @@ export function callTheTrendPort(start, end, params) {
export function totalCallsSnum(params) {
return request({
url:
`/metrics/api/v1/query?time=${params}&query=sum(apigateway_http_status)`,
`/gateway-monitor/getCallCount`,
method: 'get',
})
}

View File

@ -409,13 +409,16 @@
const TotalCallsAPI = () => {
const end = Date.parse(new Date()) / 1000
totalCallsSnum(end).then((res) => {
debugger
snum.value[1].num = res.data.data.result[0].value[1]
snum.value[1].num = Number(res.data.data)
totalCallsSnum2(end).then((resSon) => {
if (snum.value[1].num === 0) {
num.value[2].num = '100%'
} else {
snum.value[2].num =
parseInt(
(resSon.data.data.result[0].value[1] / snum.value[1].num) * 100
) + '%'
}
})
})
}