能力云图-总调用次数
This commit is contained in:
parent
f2b714a915
commit
eafd6aea19
|
@ -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',
|
||||
})
|
||||
}
|
||||
|
|
|
@ -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) => {
|
||||
snum.value[2].num =
|
||||
parseInt(
|
||||
(resSon.data.data.result[0].value[1] / snum.value[1].num) * 100
|
||||
) + '%'
|
||||
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
|
||||
) + '%'
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue