能力云图-总调用次数

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) { export function totalCallsSnum(params) {
return request({ return request({
url: url:
`/metrics/api/v1/query?time=${params}&query=sum(apigateway_http_status)`, `/gateway-monitor/getCallCount`,
method: 'get', method: 'get',
}) })
} }

View File

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