From 8376fb23d51f7454fba5008d52f743f0bfba2747 Mon Sep 17 00:00:00 2001
From: "851673013@qq.com" <851673013@qq.com>
Date: Thu, 28 Jul 2022 20:40:48 +0800
Subject: [PATCH] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E8=83=BD=E5=8A=9B=E8=BF=90?=
=?UTF-8?q?=E8=A1=8C=E7=9B=91=E6=8E=A7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../components/AbnormalSituation.vue | 315 ++++++++++++++----
.../components/AnalysisOfTheRequest.vue | 186 ++++++++---
.../CapabilityOperationMonitoring/index.vue | 61 +++-
back/src/views/modules/workBench/api.js | 208 ++++++------
.../workBench/components/lineOption.js | 243 +++++++-------
.../workBench/components/trend-view.vue | 158 +++++----
front/src/api/capabilityCloud.js | 11 +-
.../components/ComponentServices.vue | 8 +
8 files changed, 771 insertions(+), 419 deletions(-)
diff --git a/back/src/views/modules/sys/CapabilityOperationMonitoring/components/AbnormalSituation.vue b/back/src/views/modules/sys/CapabilityOperationMonitoring/components/AbnormalSituation.vue
index 3094693b..ff3d8f7f 100644
--- a/back/src/views/modules/sys/CapabilityOperationMonitoring/components/AbnormalSituation.vue
+++ b/back/src/views/modules/sys/CapabilityOperationMonitoring/components/AbnormalSituation.vue
@@ -6,14 +6,14 @@
API总数
-
99999
+
{{ Apisnum }}
异常API总数
-
99999
+
{{ ApisnumShiBai }}
@@ -24,12 +24,23 @@
API异常次数排行TOP10
- -
- {{ index + 1 }}
-
+
-
+ {{ index + 1 }}
+
{{ item.name }}
- {{ item.num }}
+ {{ item.count }}
@@ -45,24 +56,62 @@
API异常次数统计
-
+
-
+
-
+
-
+
-
+
-
+
@@ -72,55 +121,26 @@
\ No newline at end of file
+
diff --git a/front/src/api/capabilityCloud.js b/front/src/api/capabilityCloud.js
index 8c72303b..d6e2e151 100644
--- a/front/src/api/capabilityCloud.js
+++ b/front/src/api/capabilityCloud.js
@@ -97,8 +97,15 @@ export function callTheTrendPort(start, end, params) {
export function totalCallsSnum(params) {
return request({
url:
- '/metrics/api/v1/query?query=sum(apigateway_http_status)&time=1655793262.495' +
- params,
+ `metrics/api/v1/query?query=sum(increase(apigateway_http_status))&time=${params}`,
+ method: 'get',
+ })
+}
+//能力云图-调用成功次数
+export function totalCallsSnum2(params) {
+ return request({
+ url:
+ `metrics/api/v1/query?query=sum(increase(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 799722d6..b3359fd0 100644
--- a/front/src/views/capabilityCloud/components/ComponentServices.vue
+++ b/front/src/views/capabilityCloud/components/ComponentServices.vue
@@ -119,6 +119,7 @@
componentServiceRank,
callTheTrendPort,
totalCallsSnum,
+ totalCallsSnum2,
} from '@/api/capabilityCloud'
import * as moment from 'moment'
let xinhaianIsShow = whoShow.itShowXiHaiAn //判断是否是西海岸版本
@@ -410,6 +411,13 @@
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 +
+ '%'
+ })
})
}
}