2022-07-18 15:04:32 +08:00
|
|
|
<template>
|
2022-07-19 09:52:28 +08:00
|
|
|
<div class="npm-network-quantity">
|
2022-08-08 17:45:50 +08:00
|
|
|
<single-value
|
|
|
|
|
:npm-network-cycle-data="npmNetworkCycleData"
|
|
|
|
|
:npm-network-name="npmNetworkName"
|
2022-08-15 15:53:42 +08:00
|
|
|
:time-filter="timeFilter"
|
2022-08-08 17:45:50 +08:00
|
|
|
></single-value>
|
2022-07-19 09:52:28 +08:00
|
|
|
</div>
|
2022-07-18 15:04:32 +08:00
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-07-19 09:52:28 +08:00
|
|
|
import SingleValue from '@/views/charts2/charts/SingleValue'
|
2022-08-08 17:45:50 +08:00
|
|
|
import { get } from '@/utils/http'
|
|
|
|
|
import { getSecond } from '@/utils/date-util'
|
|
|
|
|
import { api } from '@/utils/api'
|
2022-07-19 09:52:28 +08:00
|
|
|
|
2022-07-18 15:04:32 +08:00
|
|
|
export default {
|
2022-07-19 09:52:28 +08:00
|
|
|
name: 'NpmNetworkQuantity',
|
|
|
|
|
components: { SingleValue },
|
2022-08-08 17:45:50 +08:00
|
|
|
props: {
|
|
|
|
|
chart: Object,
|
|
|
|
|
timeFilter: Object
|
|
|
|
|
},
|
2022-07-19 09:52:28 +08:00
|
|
|
data () {
|
|
|
|
|
return {
|
2022-08-08 17:45:50 +08:00
|
|
|
npmNetworkName: [
|
2022-08-09 11:39:08 +08:00
|
|
|
{ name: 'networkAppPerformance.tcpConnectionEstablishLatency' },
|
|
|
|
|
{ name: 'networkAppPerformance.httpResponse' },
|
|
|
|
|
{ name: 'networkAppPerformance.sslResponseLatency' },
|
|
|
|
|
{ name: 'networkAppPerformance.packetLoss' },
|
|
|
|
|
{ name: 'overall.packetRetrans' }
|
2022-08-08 17:45:50 +08:00
|
|
|
],
|
2022-08-15 15:53:42 +08:00
|
|
|
npmNetworkCycleData: []
|
2022-08-08 17:45:50 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
npmNetworkCycleQuery () {
|
|
|
|
|
const params = {
|
|
|
|
|
startTime: getSecond(this.timeFilter.startTime),
|
|
|
|
|
endTime: getSecond(this.timeFilter.endTime),
|
|
|
|
|
cycle: 0
|
|
|
|
|
}
|
2022-08-09 11:39:08 +08:00
|
|
|
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)
|
|
|
|
|
Promise.all([tcp, http, ssl, tcpPercent, packetPercent]).then(res => {
|
|
|
|
|
res.forEach(t => {
|
|
|
|
|
if (t.code === 200) {
|
|
|
|
|
this.npmNetworkCycleData.push(t.data.result)
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
})
|
2022-07-19 09:52:28 +08:00
|
|
|
}
|
2022-08-15 15:53:42 +08:00
|
|
|
|
2022-08-08 17:45:50 +08:00
|
|
|
},
|
|
|
|
|
mounted () {
|
|
|
|
|
this.npmNetworkCycleQuery()
|
2022-07-19 09:52:28 +08:00
|
|
|
}
|
2022-07-18 15:04:32 +08:00
|
|
|
}
|
|
|
|
|
</script>
|