From d8cbe92fb63a8cebc835cb9533b58dcfbb671307 Mon Sep 17 00:00:00 2001 From: "851673013@qq.com" <851673013@qq.com> Date: Fri, 29 Jul 2022 14:14:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E5=8F=B0=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E8=83=BD=E5=8A=9B=E9=A3=8E=E9=99=A9=E5=92=8C=E8=83=BD=E5=8A=9B?= =?UTF-8?q?=E4=BA=91=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workBench/components/risk-view.vue | 133 +++++++++++++++--- front/src/api/capabilityCloud.js | 4 +- .../components/ComponentServices.vue | 18 +-- 3 files changed, 124 insertions(+), 31 deletions(-) diff --git a/back/src/views/modules/workBench/components/risk-view.vue b/back/src/views/modules/workBench/components/risk-view.vue index 33fb27ad..f7f884d3 100644 --- a/back/src/views/modules/workBench/components/risk-view.vue +++ b/back/src/views/modules/workBench/components/risk-view.vue @@ -1,32 +1,129 @@ \ No newline at end of file + diff --git a/front/src/api/capabilityCloud.js b/front/src/api/capabilityCloud.js index d6e2e151..011517fe 100644 --- a/front/src/api/capabilityCloud.js +++ b/front/src/api/capabilityCloud.js @@ -97,7 +97,7 @@ export function callTheTrendPort(start, end, params) { export function totalCallsSnum(params) { return request({ url: - `metrics/api/v1/query?query=sum(increase(apigateway_http_status))&time=${params}`, + `/metrics/api/v1/query?time=${params}&query=sum(apigateway_http_status)`, method: 'get', }) } @@ -105,7 +105,7 @@ export function totalCallsSnum(params) { export function totalCallsSnum2(params) { return request({ url: - `metrics/api/v1/query?query=sum(increase(apigateway_http_status{code=~"^2.."}))&time=${params}`, + `metrics/api/v1/query?query=sum(apigateway_http_status{code=~"^2.."})&time=${params}`, method: 'get', }) } diff --git a/front/src/views/capabilityCloud/components/ComponentServices.vue b/front/src/views/capabilityCloud/components/ComponentServices.vue index b3359fd0..fc2dbd45 100644 --- a/front/src/views/capabilityCloud/components/ComponentServices.vue +++ b/front/src/views/capabilityCloud/components/ComponentServices.vue @@ -408,18 +408,14 @@ //总调用次数接口 const TotalCallsAPI = () => { const end = Date.parse(new Date()) / 1000 - if (!xinhaianIsShow) { - totalCallsSnum(end).then((res) => { - snum.value[1].num = res.data.data.result[0].value[1] - totalCallsSnum2(end).then((resSon) => { - snum.value[2].num = - ((snum.value[1].num - resSon.data.data.result[0].value[1]) / - snum.value[1].num) * - 100 + - '%' - }) + totalCallsSnum(end).then((res) => { + debugger + snum.value[1].num = res.data.data.result[0].value[1] + totalCallsSnum2(end).then((resSon) => { + snum.value[2].num = + (resSon.data.data.result[0].value[1] / snum.value[1].num) * 100 + '%' }) - } + }) } const init = () => { timeSwitch(timeSwitchindex.value)