fix: 修复 npm 下钻接口字段
This commit is contained in:
@@ -81,14 +81,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.el-table__header-wrapper .el-table__header {
|
||||||
|
tr th:nth-last-child(-n+3) {
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
.el-table__body-wrapper.is-scrolling-none {
|
.el-table__body-wrapper.is-scrolling-none {
|
||||||
height: 306px !important;
|
height: 306px !important;
|
||||||
tr td {
|
tr td {
|
||||||
padding: 13px 0;
|
padding: 13px 0;
|
||||||
}
|
}
|
||||||
|
tr td:nth-last-child(-n+3) {
|
||||||
|
text-align: center;
|
||||||
|
.data-total {
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.data-total{
|
.data-total {
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
.data-total-category-icon {
|
.data-total-category-icon {
|
||||||
i {
|
i {
|
||||||
@@ -122,15 +133,25 @@
|
|||||||
background: #749F4D;
|
background: #749F4D;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
.data-total-value {
|
||||||
|
display: flex;
|
||||||
|
justify-content: right;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
|
.data-trend{
|
||||||
|
display: flex;
|
||||||
|
width: 50%;
|
||||||
|
}
|
||||||
.data-total-trend {
|
.data-total-trend {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
justify-content: left;
|
||||||
margin-left: 6px;
|
margin-left: 6px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
margin-top: 2px;
|
margin-top: 2px;
|
||||||
border-radius: 10px;
|
border-radius: 10px;
|
||||||
font-weight:500;
|
font-weight: 500;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
padding: 0 5px;
|
padding: 0 5px;
|
||||||
@@ -142,11 +163,11 @@
|
|||||||
}
|
}
|
||||||
.data-total-trend-green {
|
.data-total-trend-green {
|
||||||
background-color: rgba(126,159,84,0.12);
|
background-color: rgba(126,159,84,0.12);
|
||||||
color:#7E9F54;
|
color: #7E9F54;
|
||||||
}
|
}
|
||||||
.data-total-trend-red {
|
.data-total-trend-red {
|
||||||
background-color: rgba(226,97,84,0.12);
|
background-color: rgba(226,97,84,0.12);
|
||||||
color:#E26154;
|
color: #E26154;
|
||||||
.cn-icon-rise1{
|
.cn-icon-rise1{
|
||||||
color: #E44D3E;
|
color: #E44D3E;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -163,6 +163,8 @@ export const api = {
|
|||||||
relatedSessions: '/interface/application/performance/relatedSessions',
|
relatedSessions: '/interface/application/performance/relatedSessions',
|
||||||
// 各维度下钻流量曲线图
|
// 各维度下钻流量曲线图
|
||||||
trafficGraph: '/interface/application/performance/overview/drilldown/drilldown/dimension/trafficGraph',
|
trafficGraph: '/interface/application/performance/overview/drilldown/drilldown/dimension/trafficGraph',
|
||||||
|
// 各维度下钻网络性能
|
||||||
|
networkAnalysis: '/interface/application/performance/overview/drilldown/dimension/networkAnalysis',
|
||||||
// 下钻地图
|
// 下钻地图
|
||||||
map: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/trafficAnalysis',
|
map: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/trafficAnalysis',
|
||||||
mapTcp: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/tcpSessionDelay',
|
mapTcp: '/interface/application/performance/overview/drilldown/dimension/clientLocations/world/tcpSessionDelay',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<template v-if="index === 0">
|
<template v-if="index === 0">
|
||||||
<div class="single-value__title">{{$t(npmNetworkName[index].name)}}</div>
|
<div class="single-value__title">{{$t(npmNetworkName[index].name)}}</div>
|
||||||
<div class="single-value__content">
|
<div class="single-value__content">
|
||||||
<div class="single-value__content-number">{{unitConvert(npm.establishLatencyAvg, unitTypes.time).join(' ')}}</div>
|
<div class="single-value__content-number">{{unitConvert(npm.establishLatencyMsAvg, unitTypes.time).join(' ')}}</div>
|
||||||
<div v-if="npm.value > 0" class="single-value__content-trend single-value__content-trend-red">
|
<div v-if="npm.value > 0" class="single-value__content-trend single-value__content-trend-red">
|
||||||
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(npm.value, unitTypes.percent).join('')}}
|
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(npm.value, unitTypes.percent).join('')}}
|
||||||
</div>
|
</div>
|
||||||
@@ -16,8 +16,8 @@
|
|||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-value__circle">
|
<div class="single-value__circle">
|
||||||
<div class="single-value__circle-p95">P95: {{unitConvert(npm.establishLatencyP95, unitTypes.time).join(' ')}}</div>
|
<div class="single-value__circle-p95">P95: {{unitConvert(npm.establishLatencyMsP95, unitTypes.time).join(' ')}}</div>
|
||||||
<div class="single-value__circle-p99">P99: {{unitConvert(npm.establishLatencyP99, unitTypes.time).join(' ')}}</div>
|
<div class="single-value__circle-p99">P99: {{unitConvert(npm.establishLatencyMsP99, unitTypes.time).join(' ')}}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="index === 1">
|
<template v-if="index === 1">
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
<template v-if="index === 3">
|
<template v-if="index === 3">
|
||||||
<div class="single-value__title">{{$t(npmNetworkName[index].name)}}</div>
|
<div class="single-value__title">{{$t(npmNetworkName[index].name)}}</div>
|
||||||
<div class="single-value__content">
|
<div class="single-value__content">
|
||||||
<div class="single-value__content-number">{{unitConvert(npm.sequenceGapLossAvg, unitTypes.percent).join(' ')}}</div>
|
<div class="single-value__content-number">{{unitConvert(npm.tcpLostlenPercentAvg, unitTypes.percent).join(' ')}}</div>
|
||||||
<div v-if="npm.value > 0" class="single-value__content-trend single-value__content-trend-red">
|
<div v-if="npm.value > 0" class="single-value__content-trend single-value__content-trend-red">
|
||||||
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(npm.value, unitTypes.percent).join('')}}
|
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(npm.value, unitTypes.percent).join('')}}
|
||||||
</div>
|
</div>
|
||||||
@@ -76,14 +76,14 @@
|
|||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-value__circle">
|
<div class="single-value__circle">
|
||||||
<div class="single-value__circle-p95">P95: {{unitConvert(npm.sequenceGapLossP95, unitTypes.percent).join(' ')}}</div>
|
<div class="single-value__circle-p95">P95: {{unitConvert(npm.tcpLostlenPercentP95, unitTypes.percent).join(' ')}}</div>
|
||||||
<div class="single-value__circle-p99">P99: {{unitConvert(npm.sequenceGapLossP99, unitTypes.percent).join(' ')}}</div>
|
<div class="single-value__circle-p99">P99: {{unitConvert(npm.tcpLostlenPercentP99, unitTypes.percent).join(' ')}}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template v-if="index === 4">
|
<template v-if="index === 4">
|
||||||
<div class="single-value__title">{{$t(npmNetworkName[index].name)}}</div>
|
<div class="single-value__title">{{$t(npmNetworkName[index].name)}}</div>
|
||||||
<div class="single-value__content">
|
<div class="single-value__content">
|
||||||
<div class="single-value__content-number">{{unitConvert(npm.pktRetransAvg, unitTypes.percent).join(' ')}}</div>
|
<div class="single-value__content-number">{{unitConvert(npm.pktRetransPercentAvg, unitTypes.percent).join(' ')}}</div>
|
||||||
<div v-if="npm.value > 0" class="single-value__content-trend single-value__content-trend-red">
|
<div v-if="npm.value > 0" class="single-value__content-trend single-value__content-trend-red">
|
||||||
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(npm.value, unitTypes.percent).join('')}}
|
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(npm.value, unitTypes.percent).join('')}}
|
||||||
</div>
|
</div>
|
||||||
@@ -96,8 +96,8 @@
|
|||||||
<div v-else></div>
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="single-value__circle">
|
<div class="single-value__circle">
|
||||||
<div class="single-value__circle-p95">P95: {{unitConvert(npm.pktRetransP95, unitTypes.percent).join(' ')}}</div>
|
<div class="single-value__circle-p95">P95: {{unitConvert(npm.pktRetransPercentP95, unitTypes.percent).join(' ')}}</div>
|
||||||
<div class="single-value__circle-p99">P99: {{unitConvert(npm.pktRetransP99, unitTypes.percent).join(' ')}}</div>
|
<div class="single-value__circle-p99">P99: {{unitConvert(npm.pktRetransPercentP99, unitTypes.percent).join(' ')}}</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -34,43 +34,49 @@
|
|||||||
<span class="data-total-category-value">{{$t(scope.row.i18n)}}</span>
|
<span class="data-total-category-value">{{$t(scope.row.i18n)}}</span>
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'total'">
|
<template v-else-if="item.prop === 'total'">
|
||||||
{{unitConvert(scope.row.totalPacketsRate, unitTypes.bps).join('')}}
|
<div class="data-total-value">{{unitConvert(scope.row.totalPacketsRate, unitTypes.bps).join('')}}</div>
|
||||||
<div v-if="scope.row.bytesRateChainRatio > 0" class="data-total-trend data-total-trend-red">
|
<div class="data-trend">
|
||||||
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(scope.row.bytesRateChainRatio, unitTypes.percent).join('')}}
|
<div v-if="scope.row.bytesRateChainRatio > 0" class="data-total-trend data-total-trend-red">
|
||||||
|
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(scope.row.bytesRateChainRatio, unitTypes.percent).join('')}}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.bytesRateChainRatio < 0" class="data-total-trend data-total-trend-green">
|
||||||
|
<i class="cn-icon-decline cn-icon"></i> {{unitConvert(scope.row.bytesRateChainRatio, unitTypes.percent).join('').replaceAll('-', '')}}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.bytesRateChainRatio === 0" class="data-total-trend data-total-trend-black">
|
||||||
|
<i class="cn-icon-constant cn-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="scope.row.bytesRateChainRatio < 0" class="data-total-trend data-total-trend-green">
|
|
||||||
<i class="cn-icon-decline cn-icon"></i> {{unitConvert(scope.row.bytesRateChainRatio, unitTypes.percent).join('').replaceAll('-', '')}}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="scope.row.bytesRateChainRatio === 0" class="data-total-trend data-total-trend-black">
|
|
||||||
<i class="cn-icon-constant cn-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div v-else></div>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'outbound'">
|
<template v-else-if="item.prop === 'outbound'">
|
||||||
{{unitConvert(scope.row.outboundPacketsRate, unitTypes.bps).join('')}}
|
<div class="data-total-value">{{unitConvert(scope.row.outboundPacketsRate, unitTypes.bps).join('')}}</div>
|
||||||
<div v-if="scope.row.outboundBytesRateChainRatio > 0" class="data-total-trend data-total-trend-red">
|
<div class="data-trend">
|
||||||
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(scope.row.outboundBytesRateChainRatio, unitTypes.percent).join('')}}
|
<div v-if="scope.row.outboundBytesRateChainRatio > 0" class="data-total-trend data-total-trend-red">
|
||||||
|
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(scope.row.outboundBytesRateChainRatio, unitTypes.percent).join('')}}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.outboundBytesRateChainRatio < 0" class="data-total-trend data-total-trend-green">
|
||||||
|
<i class="cn-icon-decline cn-icon"></i> {{unitConvert(scope.row.outboundBytesRateChainRatio, unitTypes.percent).join('').replaceAll('-', '')}}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.outboundBytesRateChainRatio === 0" class="data-total-trend data-total-trend-black">
|
||||||
|
<i class="cn-icon-constant cn-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="scope.row.outboundBytesRateChainRatio < 0" class="data-total-trend data-total-trend-green">
|
|
||||||
<i class="cn-icon-decline cn-icon"></i> {{unitConvert(scope.row.outboundBytesRateChainRatio, unitTypes.percent).join('').replaceAll('-', '')}}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="scope.row.outboundBytesRateChainRatio === 0" class="data-total-trend data-total-trend-black">
|
|
||||||
<i class="cn-icon-constant cn-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div v-else></div>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'inbound'">
|
<template v-else-if="item.prop === 'inbound'">
|
||||||
{{unitConvert(scope.row.inboundPacketsRate, unitTypes.bps).join('')}}
|
<div class="data-total-value">{{unitConvert(scope.row.inboundPacketsRate, unitTypes.bps).join('')}}</div>
|
||||||
<div v-if="scope.row.inboundBytesRateChainRatio > 0" class="data-total-trend data-total-trend-red">
|
<div class="data-trend">
|
||||||
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(scope.row.inboundBytesRateChainRatio, unitTypes.percent).join('')}}
|
<div v-if="scope.row.inboundBytesRateChainRatio > 0" class="data-total-trend data-total-trend-red">
|
||||||
|
<i class="cn-icon-rise1 cn-icon"></i> {{unitConvert(scope.row.inboundBytesRateChainRatio, unitTypes.percent).join('')}}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.inboundBytesRateChainRatio < 0" class="data-total-trend data-total-trend-green">
|
||||||
|
<i class="cn-icon-decline cn-icon"></i> {{unitConvert(scope.row.inboundBytesRateChainRatio, unitTypes.percent).join('').replaceAll('-', '')}}
|
||||||
|
</div>
|
||||||
|
<div v-else-if="scope.row.inboundBytesRateChainRatio === 0" class="data-total-trend data-total-trend-black">
|
||||||
|
<i class="cn-icon-constant cn-icon"></i>
|
||||||
|
</div>
|
||||||
|
<div v-else></div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else-if="scope.row.inboundBytesRateChainRatio < 0" class="data-total-trend data-total-trend-green">
|
|
||||||
<i class="cn-icon-decline cn-icon"></i> {{unitConvert(scope.row.inboundBytesRateChainRatio, unitTypes.percent).join('').replaceAll('-', '')}}
|
|
||||||
</div>
|
|
||||||
<div v-else-if="scope.row.inboundBytesRateChainRatio === 0" class="data-total-trend data-total-trend-black">
|
|
||||||
<i class="cn-icon-constant cn-icon"></i>
|
|
||||||
</div>
|
|
||||||
<div v-else></div>
|
|
||||||
</template>
|
</template>
|
||||||
<template v-else-if="item.prop === 'score'">
|
<template v-else-if="item.prop === 'score'">
|
||||||
<div v-if="scope.row.score <= 2" :class="{'data-score-red': scope.row.score <= 2}" class="data-score">
|
<div v-if="scope.row.score <= 2" :class="{'data-score-red': scope.row.score <= 2}" class="data-score">
|
||||||
|
|||||||
@@ -82,21 +82,59 @@ export default {
|
|||||||
params.type = type
|
params.type = type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const tcp = get(api.npm.overview.tcpSessionDelay, params)
|
if (type && condition) {
|
||||||
const http = get(api.npm.overview.httpResponseDelay, params)
|
this.toggleLoading(true)
|
||||||
const ssl = get(api.npm.overview.sslConDelay, params)
|
get(api.npm.overview.networkAnalysis, params).then(res => {
|
||||||
const tcpPercent = get(api.npm.overview.tcpLostlenPercent, params)
|
if (res.code === 200) {
|
||||||
const packetPercent = get(api.npm.overview.packetRetransPercent, params)
|
res.data.result = {
|
||||||
this.toggleLoading(true)
|
establishLatencyMsAvg: 0.16,
|
||||||
Promise.all([tcp, http, ssl, tcpPercent, packetPercent]).then(res => {
|
establishLatencyMsP50: 0.16,
|
||||||
res.forEach(t => {
|
establishLatencyMsP90: 0.16,
|
||||||
if (t.code === 200) {
|
establishLatencyMsP95: 0.16,
|
||||||
this.npmNetworkCycleData.push(t.data.result)
|
establishLatencyMsP99: 0.16,
|
||||||
|
httpResponseLatencyAvg: 0.16,
|
||||||
|
httpResponseLatencyP50: 0.16,
|
||||||
|
httpResponseLatencyP90: 0.16,
|
||||||
|
httpResponseLatencyP95: 0.16,
|
||||||
|
httpResponseLatencyP99: 0.16,
|
||||||
|
sslConLatencyAvg: 0.16,
|
||||||
|
sslConLatencyP50: 0.16,
|
||||||
|
sslConLatencyP90: 0.16,
|
||||||
|
sslConLatencyP95: 0.16,
|
||||||
|
sslConLatencyP99: 0.16,
|
||||||
|
tcpLostlenPercentAvg: 0.16,
|
||||||
|
tcpLostlenPercentP50: 0.16,
|
||||||
|
tcpLostlenPercentP90: 0.16,
|
||||||
|
tcpLostlenPercentP95: 0.16,
|
||||||
|
tcpLostlenPercentP99: 0.16,
|
||||||
|
pktRetransPercentAvg: 0.16,
|
||||||
|
pktRetransPercentP50: 0.16,
|
||||||
|
pktRetransPercentP90: 0.16,
|
||||||
|
pktRetransPercentP95: 0.16,
|
||||||
|
pktRetransPercentP99: 0.16
|
||||||
|
}
|
||||||
|
this.npmNetworkCycleData = res.data.result
|
||||||
}
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.toggleLoading(false)
|
||||||
})
|
})
|
||||||
}).finally(() => {
|
} else {
|
||||||
this.toggleLoading(false)
|
const tcp = get(api.npm.overview.tcpSessionDelay, params)
|
||||||
})
|
const http = get(api.npm.overview.httpResponseDelay, params)
|
||||||
|
const ssl = get(api.npm.overview.sslConDelay, params)
|
||||||
|
const tcpPercent = get(api.npm.overview.tcpLostlenPercent, params)
|
||||||
|
const packetPercent = get(api.npm.overview.packetRetransPercent, params)
|
||||||
|
this.toggleLoading(true)
|
||||||
|
Promise.all([tcp, http, ssl, tcpPercent, packetPercent]).then(res => {
|
||||||
|
res.forEach(t => {
|
||||||
|
if (t.code === 200) {
|
||||||
|
this.npmNetworkCycleData.push(t.data.result)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
this.toggleLoading(false)
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
npmNetworkLastCycleQuery () {
|
npmNetworkLastCycleQuery () {
|
||||||
let condition = ''
|
let condition = ''
|
||||||
@@ -134,63 +172,127 @@ export default {
|
|||||||
params.type = type
|
params.type = type
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const tcp = get(api.npm.overview.tcpSessionDelay, params)
|
if (type && condition) {
|
||||||
const http = get(api.npm.overview.httpResponseDelay, params)
|
this.toggleLoading(true)
|
||||||
const ssl = get(api.npm.overview.sslConDelay, params)
|
get(api.npm.overview.networkAnalysis, params).then(res => {
|
||||||
const tcpPercent = get(api.npm.overview.tcpLostlenPercent, params)
|
const keyPre = ['tcp', 'http', 'ssl', 'tcpLost', 'packetRetrans']
|
||||||
const packetPercent = get(api.npm.overview.packetRetransPercent, params)
|
const scoreInfo = {}
|
||||||
this.toggleLoading(true)
|
let index = 0
|
||||||
Promise.all([tcp, http, ssl, tcpPercent, packetPercent]).then(res => {
|
if (res.code === 200) {
|
||||||
const keyPre = ['tcp', 'http', 'ssl', 'tcpLost', 'packetRetrans']
|
res.data.result = {
|
||||||
const scoreInfo = {}
|
establishLatencyMsAvg: 0.16,
|
||||||
res.forEach((t, i) => {
|
httpResponseLatencyAvg: 0.16,
|
||||||
if (t.code === 200) {
|
sslConLatencyAvg: 0.16,
|
||||||
if (t.data.result.establishLatencyAvg || t.data.result.establishLatencyAvg === 0) {
|
tcpLostlenPercentAvg: 1,
|
||||||
t.data.result.establishLatencyMs = t.data.result.establishLatencyAvg
|
pktRetransPercentAvg: 1
|
||||||
}
|
}
|
||||||
if (t.data.result.httpResponseLatencyAvg || t.data.result.httpResponseLatencyAvg === 0) {
|
if (res.data.result.establishLatencyMsAvg || res.data.result.establishLatencyMsAvg === 0) {
|
||||||
t.data.result.httpResponseLatency = t.data.result.httpResponseLatencyAvg
|
res.data.result.establishLatencyMs = res.data.result.establishLatencyMsAvg
|
||||||
|
index = 0
|
||||||
}
|
}
|
||||||
if (t.data.result.sequenceGapLossAvg || t.data.result.sequenceGapLossAvg === 0) {
|
if (res.data.result.httpResponseLatencyAvg || res.data.result.httpResponseLatencyAvg === 0) {
|
||||||
t.data.result.tcpLostlenPercent = t.data.result.sequenceGapLossAvg
|
res.data.result.httpResponseLatency = res.data.result.establishLatencyMsAvg
|
||||||
|
index = 1
|
||||||
}
|
}
|
||||||
if (t.data.result.pktRetransAvg || t.data.result.pktRetransAvg === 0) {
|
if (res.data.result.tcpLostlenPercentAvg || res.data.result.tcpLostlenPercentAvg === 0) {
|
||||||
t.data.result.pktRetransPercent = t.data.result.pktRetransAvg
|
res.data.result.tcpLostlenPercent = res.data.result.establishLatencyMsAvg
|
||||||
|
index = 3
|
||||||
}
|
}
|
||||||
if (t.data.result.sslConLatencyAvg || t.data.result.sslConLatencyAvg === 0) {
|
if (res.data.result.pktRetransPercentAvg || res.data.result.pktRetransPercentAvg === 0) {
|
||||||
t.data.result.sslConLatency = t.data.result.sslConLatencyAvg
|
res.data.result.pktRetransPercent = res.data.result.establishLatencyMsAvg
|
||||||
|
index = 4
|
||||||
}
|
}
|
||||||
scoreInfo[keyPre[i] + 'Score'] = computeScore(t.data.result, i)
|
if (res.data.result.sslConLatencyAvg || res.data.result.sslConLatencyAvg === 0) {
|
||||||
this.npmNetworkLastCycleData.push(t.data.result)
|
res.data.result.sslConLatency = res.data.result.establishLatencyMsAvg
|
||||||
this.npmNetworkQuantity(this.npmNetworkCycleData, this.npmNetworkLastCycleData)
|
index = 2
|
||||||
|
}
|
||||||
|
scoreInfo[keyPre[index] + 'Score'] = computeScore(res.data.result, index)
|
||||||
|
this.npmNetworkLastCycleData = res.data.result
|
||||||
|
let timer = null
|
||||||
|
if (timer) {
|
||||||
|
clearTimeout(timer)
|
||||||
|
}
|
||||||
|
timer = setTimeout(() => {
|
||||||
|
this.npmNetworkQuantity(this.npmNetworkCycleData, this.npmNetworkLastCycleData, 0)
|
||||||
|
}, 300)
|
||||||
} else {
|
} else {
|
||||||
t[keyPre[i] + 'Score'] = 0
|
res[keyPre[index] + 'Score'] = 0
|
||||||
}
|
}
|
||||||
|
scoreInfo.score = Math.ceil((scoreInfo.tcpScore + scoreInfo.httpScore + scoreInfo.sslScore + scoreInfo.tcpLostScore + scoreInfo.packetRetransScore) * 6)
|
||||||
|
if (scoreInfo.score > 6) {
|
||||||
|
scoreInfo.score = 6
|
||||||
|
}
|
||||||
|
if (!params.q && this.chart.id === 44) {
|
||||||
|
this.$store.commit('setNpmThirdLevelMenuScore', scoreInfo.score)
|
||||||
|
}
|
||||||
|
}).finally(() => {
|
||||||
|
this.toggleLoading(false)
|
||||||
})
|
})
|
||||||
scoreInfo.score = Math.ceil((scoreInfo.tcpScore + scoreInfo.httpScore + scoreInfo.sslScore + scoreInfo.tcpLostScore + scoreInfo.packetRetransScore) * 6)
|
} else {
|
||||||
if (scoreInfo.score > 6) {
|
const tcp = get(api.npm.overview.tcpSessionDelay, params)
|
||||||
scoreInfo.score = 6
|
const http = get(api.npm.overview.httpResponseDelay, params)
|
||||||
}
|
const ssl = get(api.npm.overview.sslConDelay, params)
|
||||||
if (!params.q && this.chart.id === 44) {
|
const tcpPercent = get(api.npm.overview.tcpLostlenPercent, params)
|
||||||
this.$store.commit('setNpmThirdLevelMenuScore', scoreInfo.score)
|
const packetPercent = get(api.npm.overview.packetRetransPercent, params)
|
||||||
}
|
this.toggleLoading(true)
|
||||||
}).finally(() => {
|
Promise.all([tcp, http, ssl, tcpPercent, packetPercent]).then(res => {
|
||||||
this.toggleLoading(false)
|
res.forEach((t, i) => {
|
||||||
})
|
if (t.code === 200) {
|
||||||
|
this.npmNetworkLastCycleData.push(t.data.result)
|
||||||
|
this.npmNetworkQuantity(this.npmNetworkCycleData, this.npmNetworkLastCycleData, 1)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}).finally(() => {
|
||||||
|
this.toggleLoading(false)
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
npmNetworkQuantity (cycle, lastCycle) {
|
npmNetworkQuantity (cycle, lastCycle, num) {
|
||||||
cycle.forEach(t => {
|
if (num === 0) {
|
||||||
lastCycle.forEach(e => {
|
this.npmNetworkData[0] = {
|
||||||
Object.keys(t).forEach(r => {
|
establishLatencyMsAvg: cycle.establishLatencyMsAvg,
|
||||||
Object.keys(e).forEach(d => {
|
establishLatencyMsP99: cycle.establishLatencyMsP99,
|
||||||
if (r === d) {
|
establishLatencyMsP95: cycle.establishLatencyMsP95,
|
||||||
t.value = getChainRatio(t[r], e[d])
|
value: getChainRatio(cycle.establishLatencyMsAvg, lastCycle.establishLatencyMsAvg)
|
||||||
}
|
}
|
||||||
|
this.npmNetworkData[1] = {
|
||||||
|
httpResponseLatencyAvg: cycle.httpResponseLatencyAvg,
|
||||||
|
httpResponseLatencyP99: cycle.httpResponseLatencyP99,
|
||||||
|
httpResponseLatencyP95: cycle.httpResponseLatencyP95,
|
||||||
|
value: getChainRatio(cycle.httpResponseLatencyAvg, lastCycle.httpResponseLatencyAvg)
|
||||||
|
}
|
||||||
|
this.npmNetworkData[2] = {
|
||||||
|
sslConLatencyAvg: cycle.sslConLatencyAvg,
|
||||||
|
sslConLatencyP99: cycle.sslConLatencyP99,
|
||||||
|
sslConLatencyP95: cycle.sslConLatencyP95,
|
||||||
|
value: getChainRatio(cycle.sslConLatencyAvg, lastCycle.sslConLatencyAvg)
|
||||||
|
}
|
||||||
|
this.npmNetworkData[3] = {
|
||||||
|
tcpLostlenPercentAvg: cycle.tcpLostlenPercentAvg,
|
||||||
|
tcpLostlenPercentP99: cycle.tcpLostlenPercentP99,
|
||||||
|
tcpLostlenPercentP95: cycle.tcpLostlenPercentP95,
|
||||||
|
value: getChainRatio(cycle.tcpLostlenPercentAvg, lastCycle.tcpLostlenPercentAvg)
|
||||||
|
}
|
||||||
|
this.npmNetworkData[4] = {
|
||||||
|
pktRetransPercentAvg: cycle.pktRetransPercentAvg,
|
||||||
|
pktRetransPercentP99: cycle.pktRetransPercentP99,
|
||||||
|
pktRetransPercentP95: cycle.pktRetransPercentP95,
|
||||||
|
value: getChainRatio(cycle.pktRetransPercentAvg, lastCycle.pktRetransPercentAvg)
|
||||||
|
}
|
||||||
|
} else if (num === 1) {
|
||||||
|
cycle.forEach(t => {
|
||||||
|
lastCycle.forEach(e => {
|
||||||
|
Object.keys(t).forEach(r => {
|
||||||
|
Object.keys(e).forEach(d => {
|
||||||
|
if (r === d) {
|
||||||
|
t.value = getChainRatio(t[r], e[d])
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
this.npmNetworkData = cycle
|
||||||
this.npmNetworkData = cycle
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
|
|||||||
Reference in New Issue
Block a user