This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/test/views/charts2/charts/networkOverview/NetworkOverviewTabs.test.js

554 lines
639 KiB
JavaScript
Raw Normal View History

2023-02-28 11:49:13 +08:00
import NetworkOverviewTabs from '@/views/charts2/charts/networkOverview/NetworkOverviewTabs'
import { mount } from '@vue/test-utils'
import axios from 'axios'
import ElementPlus from 'element-plus'
import indexedDBUtils from '@/indexedDB'
import { createStore} from 'vuex'
const drilldownTableConfig = {"id":"default","version":"22.12","config":[{"route":"networkOverview","tables":[{"id":"networkOverview","hiddenColumns":[],"disabledColumns":[],"url":{"curUrl":"/interface/overview/dimensionTrafficAnalysis","cycleUrl":"/interface/overview/dimensionCycleTrafficAnalysis","drilldownCurUrl":"/interface/overview/drilldown/dimensionTrafficAnalysis","drilldownCycleUrl":"/interface/overview/drilldown/dimensionCycleTrafficAnalysis","drilldownList":"/interface/overview/drilldown/list"},"isOnlyRead":false,"panelId":1,"panelIdOfThirdMenu":13,"tabs":[{"name":"ips","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["ips","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["ips","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"countries","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["countries","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["countries","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"asns","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["asns","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["asns","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"apps","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["apps","total","inbound","outbound","internal","through"]},{"nam
const drilldownTableConfigUserSelf = {"id":"1","version":"22.12","config":[{"route":"networkOverview","tables":[{"id":"networkOverview","hiddenColumns":[],"disabledColumns":[],"url":{"curUrl":"/interface/overview/dimensionTrafficAnalysis","cycleUrl":"/interface/overview/dimensionCycleTrafficAnalysis","drilldownCurUrl":"/interface/overview/drilldown/dimensionTrafficAnalysis","drilldownCycleUrl":"/interface/overview/drilldown/dimensionCycleTrafficAnalysis","drilldownList":"/interface/overview/drilldown/list"},"isOnlyRead":false,"panelId":1,"panelIdOfThirdMenu":13,"tabs":[{"name":"ips","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["ips","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["ips","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"countries","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["countries","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["countries","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"asns","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["asns","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["asns","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"apps","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["apps","total","inbound","outbound","internal","through"]},{"n
const drilldownTableConfig2 = [{id:"1","version":"22.12","config":[{"route":"networkOverview","tables":[{"id":"networkOverview","hiddenColumns":[],"disabledColumns":[],"url":{"curUrl":"/interface/overview/dimensionTrafficAnalysis","cycleUrl":"/interface/overview/dimensionCycleTrafficAnalysis","drilldownCurUrl":"/interface/overview/drilldown/dimensionTrafficAnalysis","drilldownCycleUrl":"/interface/overview/drilldown/dimensionCycleTrafficAnalysis","drilldownList":"/interface/overview/drilldown/list"},"isOnlyRead":false,"panelId":1,"panelIdOfThirdMenu":13,"tabs":[{"name":"ips","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["ips","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["ips","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"countries","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["countries","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["countries","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"asns","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["asns","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["asns","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"apps","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["apps","total","inbound","outbound","internal","through"]},{"name":"Pa
{id:"default","version":"22.12","config":[{"route":"networkOverview","tables":[{"id":"networkOverview","hiddenColumns":[],"disabledColumns":[],"url":{"curUrl":"/interface/overview/dimensionTrafficAnalysis","cycleUrl":"/interface/overview/dimensionCycleTrafficAnalysis","drilldownCurUrl":"/interface/overview/drilldown/dimensionTrafficAnalysis","drilldownCycleUrl":"/interface/overview/drilldown/dimensionCycleTrafficAnalysis","drilldownList":"/interface/overview/drilldown/list"},"isOnlyRead":false,"panelId":1,"panelIdOfThirdMenu":13,"tabs":[{"name":"ips","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["ips","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["ips","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["ips","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"countries","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["countries","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["countries","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["countries","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"asns","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["asns","total","inbound","outbound","internal","through"]},{"name":"Sessions/s","columns":["asns","total"]}],"drilldownTabs":["ips","countries","asns","apps","providers","domains","protocols","idcTenants","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"hiddenDrilldownTabs":["asns","provinces","cities","isps","applicationCategories","domainCategories","snis","protocolPorts","clientIps","serverIps","clientCountries","serverCountries","clientProvinces","serverProvinces","clientCities","serverCities","clientIsps","serverIsps","clientIdcRenters","serverIdcRenters","clientAsns","serverAsns"],"disabledDrilldownTabs":[]},{"name":"apps","show":true,"enable":true,"panelIdOfFourthMenu":13,"hasMetricSearch":true,"metrics":[{"name":"Bits/s","columns":["apps","total","inbound","outbound","internal","through"]},{"name":"Packets/s","columns":["ap
const timeFilter = {
dateRangeValue: -1,
startTime: 1676955647,
endTime: 1676959247
}
const mockGet = { data: { status: 200, code: 200, queryKey: '88eeb92e0ddb40c0327db494cfe5c74c', success: true, message: null, statistics: { elapsed: 0, rows_read: 2, result_size: 752, result_rows: 10 }, job: null, formatType: 'json', meta: [{ name: 'app_name', type: 'string', category: 'Dimension' }, { name: 'event_severity', type: 'string', category: 'Dimension' }, { name: 'event_type', type: 'string', category: 'Dimension' }, { name: 'count', type: 'long', category: 'Metric' }], data: { resultType: 'table', result: [{ appName: 'youku', eventSeverity: 'info', eventType: 'http error', count: 6 }, { appName: 'uplive', eventSeverity: 'critical', eventType: 'http error', count: 5 }, { appName: 'youku', eventSeverity: 'low', eventType: 'http error', count: 4 }, { appName: 'apple_hls', eventSeverity: 'info', eventType: 'http error', count: 3 }, { appName: 'apple_hls', eventSeverity: 'low', eventType: 'http error', count: 3 }, { appName: 'apple_hls', eventSeverity: 'medium', eventType: 'http error', count: 2 }, { appName: 'uplive', eventSeverity: 'high', eventType: 'http error', count: 2 }, { appName: 'windows_update', eventSeverity: 'medium', eventType: 'http error', count: 2 }, { appName: 'apple_hls', eventSeverity: 'critical', eventType: 'http error', count: 1 }, { appName: 'cloudflare', eventSeverity: 'info', eventType: 'http error', count: 1 }] }, originalUrl: 'http://192.168.44.55:9999?query=SELECT%20app_name%20AS%20app_name%2C%20event_severity%20AS%20event_severity%2C%20event_type%20AS%20event_type%2C%20COUNT%28*%29%20AS%20count%20FROM%20performance_event%20WHERE%20start_time%20%3E%3D%201675580110%20AND%20end_time%20%3C%201675752910%20AND%20entity_type%20%3D%20%27app%27%20GROUP%20BY%20app_name%2Cevent_severity%2Cevent_type%20ORDER%20BY%20count%20DESC%20%20LIMIT%2010%20&format=json&option=real-time', msg: 'OK' } }
//Npm模块评分列取自协议Tab
//URL: http://localhost/#/panel/networkAppPerformance?t=1677208292833&curTab=appLabel&tableShowMore=10&tabOperationType=5&tabOperationBeforeType=5
const timeFilterScore = {
dateRangeValue: -1,
startTime: 1677224704,
endTime: 1677228304
}
const mockGetScore = { "data": {"status":200,"code":200,"queryKey":"77d0d2e9b63bd4d3e72e146d07bfeea1","success":true,"message":null,"statistics":{"elapsed":23,"rows_read":12982,"bytes_read":1667860,"result_size":13245,"result_rows":50},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"total_bytes","type":"long","category":"Metric"},{"name":"inbound_bytes","type":"long","category":"Metric"},{"name":"outbound_bytes","type":"long","category":"Metric"},{"name":"internal_bytes","type":"long","category":"Metric"},{"name":"through_bytes","type":"long","category":"Metric"},{"name":"total_packets","type":"long","category":"Metric"},{"name":"inbound_packets","type":"long","category":"Metric"},{"name":"outbound_packets","type":"long","category":"Metric"},{"name":"internal_packets","type":"long","category":"Metric"},{"name":"through_packets","type":"long","category":"Metric"},{"name":"sessions","type":"long","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"douyin","totalBytes":"50624733433","totalBitsRate":1.124994076E8,"inboundBytes":"1204941976","inboundBitsRate":2677648.8,"outboundBytes":"35887241401","outboundBitsRate":7.974942536E7,"internalBytes":"2789130","internalBitsRate":6198.08,"throughBytes":"12642099915","throughBitsRate":2.809355536E7,"totalPackets":"46466984","totalPacketsRate":"12907.50","inboundPackets":"871844","inboundPacketsRate":"242.18","outboundPackets":"25374762","outboundPacketsRate":"7048.55","internalPackets":"2803","internalPacketsRate":"0.78","throughPackets":"11517730","throughPacketsRate":"3199.37","sessions":"45706","sessionsRate":"12.70"},{"appLabel":"wechat","totalBytes":"20919373476","totalBitsRate":4.648749664E7,"inboundBytes":"73843595","inboundBitsRate":164096.88,"outboundBytes":"15167284551","outboundBitsRate":3.37050768E7,"internalBytes":"0","internalBitsRate":0.0,"throughBytes":"5171476770","throughBitsRate":1.149217064E7,"totalPackets":"23940211","totalPacketsRate":"6650.06","inboundPackets":"79706","inboundPacketsRate":"22.14","outboundPackets":"12259884","outboundPacketsRate":"3405.52","internalPackets":"0","internalPacketsRate":"0.00","throughPackets":"5928492","throughPacketsRate":"1646.80","sessions":"16014","sessionsRate":"4.45"},{"appLabel":"kuaishou","totalBytes":"13281819479","totalBitsRate":2.95151544E7,"inboundBytes":"262265833","inboundBitsRate":582812.96,"outboundBytes":"9673114377","outboundBitsRate":2.149580976E7,"internalBytes":"0","internalBitsRate":0.0,"throughBytes":"3192792324","throughBitsRate":7095094.08,"totalPackets":"12128353","totalPacketsRate":"3368.99","inboundPackets":"176498","inboundPacketsRate":"49.03","outboundPackets":"6927629","outboundPacketsRate":"1924.34","internalPackets":"0","internalPacketsRate":"0.00","throughPackets":"2898775","throughPacketsRate":"805.22","sessions":"9089","sessionsRate":"2.52"},{"appLabel":"alibaba_cloud","totalBytes":"6260272949","totalBitsRate":1.391171768E7,"inboundBytes":"3659396643","inboundBitsRate":8131992.56,"outboundBytes":"1844626448","outboundBitsRate":4099169.92,"internalBytes":"3402132","internalBitsRate":7560.32,"throughBytes":"487931658","throughBitsRate":1084292.56,"totalPackets":"6763142","totalPacketsRate":"1878.65","inboundPackets":"2605792","inboundPacketsRate":"723.83","outboundPackets":"1387989","outboundPacketsRate":"385.55","internalPackets":"4365","internalPacketsRate":"1.21","throughPackets":"483692","throughPacketsRate":"134.36","sessions":"35395","sessionsRate":"9.83"},{"appLabel":"bmff","totalBytes":"4857946055","totalBitsRate":1.079543568E7,"inboundBytes":"414403743","inboundBitsRate":920897.2,"outboundBytes":"3204382609","outboundBitsRate":7120850.24,"internalBytes":"0","internalBitsRate":0.0,"throughBytes":"1186687742","throughBitsRate":2637083.84,"totalPackets":"4362910","totalPacketsRate":"1211.92","inboundPackets":"276931","inboundPacketsRate":"76.93","outboundPackets":"2276956","outboundPacketsRate":"632.49","internalPackets":"0","internalPacketsRate":"0.00","throughPackets":"1048200","throughPacketsRate":"291.17
const mockGetScoreCycle = { "data": {"status":200,"code":200,"queryKey":"fd4b26ecb44c18b30d5cc63b6fddfc87","success":true,"message":null,"statistics":{"elapsed":3,"rows_read":8192,"bytes_read":1052435,"result_size":13243,"result_rows":50},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"total_bytes","type":"long","category":"Metric"},{"name":"inbound_bytes","type":"long","category":"Metric"},{"name":"outbound_bytes","type":"long","category":"Metric"},{"name":"internal_bytes","type":"long","category":"Metric"},{"name":"through_bytes","type":"long","category":"Metric"},{"name":"total_packets","type":"long","category":"Metric"},{"name":"inbound_packets","type":"long","category":"Metric"},{"name":"outbound_packets","type":"long","category":"Metric"},{"name":"internal_packets","type":"long","category":"Metric"},{"name":"through_packets","type":"long","category":"Metric"},{"name":"sessions","type":"long","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","totalBytes":"234195476","totalBitsRate":520434.4,"inboundBytes":"9412019","inboundBitsRate":20915.6,"outboundBytes":"166706755","outboundBitsRate":370459.44,"internalBytes":"0","internalBitsRate":0.0,"throughBytes":"52130610","throughBitsRate":115845.84,"totalPackets":"280663","totalPacketsRate":"77.96","inboundPackets":"6859","inboundPacketsRate":"1.91","outboundPackets":"135979","outboundPacketsRate":"37.77","internalPackets":"0","internalPacketsRate":"0.00","throughPackets":"70773","throughPacketsRate":"19.66","sessions":"1955","sessionsRate":"0.54"},{"appLabel":"uplive","totalBytes":"230991174","totalBitsRate":513313.76,"inboundBytes":"113277","inboundBitsRate":251.76,"outboundBytes":"189550620","outboundBitsRate":421223.6,"internalBytes":"0","internalBitsRate":0.0,"throughBytes":"39736450","throughBitsRate":88303.2,"totalPackets":"190429","totalPacketsRate":"52.90","inboundPackets":"825","inboundPacketsRate":"0.23","outboundPackets":"137922","outboundPacketsRate":"38.31","internalPackets":"0","internalPacketsRate":"0.00","throughPackets":"32741","throughPacketsRate":"9.09","sessions":"378","sessionsRate":"0.11"},{"appLabel":"experion","totalBytes":"491014216","totalBitsRate":1091142.72,"inboundBytes":"0","inboundBitsRate":0.0,"outboundBytes":"433991143","outboundBitsRate":964424.8,"internalBytes":"244","internalBitsRate":0.56,"throughBytes":"53212676","throughBitsRate":118250.4,"totalPackets":"403752","totalPacketsRate":"112.15","inboundPackets":"0","inboundPacketsRate":"0.00","outboundPackets":"315145","outboundPacketsRate":"87.54","internalPackets":"2","internalPacketsRate":"0.00","throughPackets":"42875","throughPacketsRate":"11.91","sessions":"248","sessionsRate":"0.07"},{"appLabel":"xiaomi","totalBytes":"651103114","totalBitsRate":1446895.84,"inboundBytes":"2485299","inboundBitsRate":5522.88,"outboundBytes":"524581871","outboundBitsRate":1165737.52,"internalBytes":"5716","internalBitsRate":12.72,"throughBytes":"113642814","throughBitsRate":252539.6,"totalPackets":"612399","totalPacketsRate":"170.11","inboundPackets":"3049","inboundPacketsRate":"0.85","outboundPackets":"365920","outboundPacketsRate":"101.64","internalPackets":"18","internalPacketsRate":"0.01","throughPackets":"108229","throughPacketsRate":"30.06","sessions":"814","sessionsRate":"0.23"},{"appLabel":"qq_web","totalBytes":"2941886476","totalBitsRate":6537525.52,"inboundBytes":"767969810","inboundBitsRate":1706599.6,"outboundBytes":"1691846972","outboundBitsRate":3759659.92,"internalBytes":"514968","internalBitsRate":1144.4,"throughBytes":"416504962","throughBitsRate":925566.56,"totalPackets":"3315391","totalPacketsRate":"920.94","inboundPackets":"587599","inboundPacketsRate":"163.22","outboundPackets":"1341908","outboundPacketsRate":"372.75","internalPackets":"394","internalPacketsRate":"0.11","throughPackets":"471886","throughPacketsRate":"131.08","sessions":"7323","sessionsRate":"2.03"},{"appLabel":"mpegts","totalBytes":"253158294","totalBitsRate":562574.0,"inboundBytes":"55484613","inboundBitsRate":123299.12,"
const mockGetScoreTcpSessionDelay = { "data": {"status":200,"code":200,"queryKey":"f05779a266fb8bbd0c051ed663b01959","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":12982,"bytes_read":434570,"result_size":2278,"result_rows":44},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"establish_latency_ms","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","establishLatencyMs":55.5352},{"appLabel":"uplive","establishLatencyMs":58.6912},{"appLabel":"xiaomi","establishLatencyMs":124.1933},{"appLabel":"qq_web","establishLatencyMs":69.4263},{"appLabel":"mpegts","establishLatencyMs":68.338},{"appLabel":"kuaishou","establishLatencyMs":152.8126},{"appLabel":"iperf","establishLatencyMs":80.6056},{"appLabel":"mango_tv","establishLatencyMs":49.3942},{"appLabel":"youku","establishLatencyMs":80.0452},{"appLabel":"huawei","establishLatencyMs":81.0782},{"appLabel":"ximalaya","establishLatencyMs":51.9153},{"appLabel":"bilibili","establishLatencyMs":59.631},{"appLabel":"ixigua","establishLatencyMs":65.2419},{"appLabel":"mitalk","establishLatencyMs":67.7998},{"appLabel":"163com","establishLatencyMs":93.4482},{"appLabel":"meitu","establishLatencyMs":67.4668},{"appLabel":"tencent","establishLatencyMs":438.6293},{"appLabel":"netease","establishLatencyMs":68.5645},{"appLabel":"http2","establishLatencyMs":90.4227},{"appLabel":"flash","establishLatencyMs":75.2766},{"appLabel":"jingdong","establishLatencyMs":60.4286},{"appLabel":"douyin","establishLatencyMs":77.5058},{"appLabel":"baidu","establishLatencyMs":83.1121},{"appLabel":"taobao","establishLatencyMs":61.2705},{"appLabel":"appstore","establishLatencyMs":37.375},{"appLabel":"toutiao","establishLatencyMs":77.0087},{"appLabel":"cibn","establishLatencyMs":52.5308},{"appLabel":"iqiyi","establishLatencyMs":80.0559},{"appLabel":"bmff","establishLatencyMs":81.9451},{"appLabel":"kugou","establishLatencyMs":84.9294},{"appLabel":"wechat","establishLatencyMs":107.2539},{"appLabel":"windows_update","establishLatencyMs":99.6507},{"appLabel":"gaode_map","establishLatencyMs":214.3703},{"appLabel":"uc_browser","establishLatencyMs":100.8159},{"appLabel":"office365","establishLatencyMs":75.645},{"appLabel":"bytedance","establishLatencyMs":74.9056},{"appLabel":"bittorrent","establishLatencyMs":389.0739},{"appLabel":"alibaba_cloud","establishLatencyMs":68.9263},{"appLabel":"pinduoduo","establishLatencyMs":150.425},{"appLabel":"alibaba_group","establishLatencyMs":96.1614},{"appLabel":"chinanetcenter","establishLatencyMs":93.537},{"appLabel":"sina_weibo","establishLatencyMs":57.2906},{"appLabel":"xiaohongshu","establishLatencyMs":92.3296},{"appLabel":"netease_cloud_music","establishLatencyMs":92.2846}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(avg_establish_latency_ms), 4) AS establish_latency_ms FROM metric_application WHERE stat_time >= toDateTime(1677224704) AND stat_time < toDateTime(1677228304) AND isNotNull(avg_establish_latency_ms) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScoreSslConDelay = { "data": {"status":200,"code":200,"queryKey":"aee5b9b64bb69bba39d490fdad1bed7e","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":12982,"bytes_read":434570,"result_size":1672,"result_rows":41},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"ssl_con_latency","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","sslConLatency":0},{"appLabel":"uplive","sslConLatency":0},{"appLabel":"xiaomi","sslConLatency":0},{"appLabel":"qq_web","sslConLatency":0},{"appLabel":"kuaishou","sslConLatency":0},{"appLabel":"iperf","sslConLatency":0},{"appLabel":"mango_tv","sslConLatency":0},{"appLabel":"youku","sslConLatency":0},{"appLabel":"huawei","sslConLatency":0},{"appLabel":"ximalaya","sslConLatency":0},{"appLabel":"bilibili","sslConLatency":0},{"appLabel":"ixigua","sslConLatency":0},{"appLabel":"mitalk","sslConLatency":0},{"appLabel":"163com","sslConLatency":0},{"appLabel":"meitu","sslConLatency":0},{"appLabel":"tencent","sslConLatency":0},{"appLabel":"netease","sslConLatency":0},{"appLabel":"http2","sslConLatency":0},{"appLabel":"jingdong","sslConLatency":0},{"appLabel":"douyin","sslConLatency":0},{"appLabel":"baidu","sslConLatency":0},{"appLabel":"taobao","sslConLatency":0},{"appLabel":"appstore","sslConLatency":0},{"appLabel":"toutiao","sslConLatency":0},{"appLabel":"cibn","sslConLatency":0},{"appLabel":"iqiyi","sslConLatency":0},{"appLabel":"bmff","sslConLatency":0},{"appLabel":"kugou","sslConLatency":0},{"appLabel":"wechat","sslConLatency":0},{"appLabel":"windows_update","sslConLatency":0},{"appLabel":"gaode_map","sslConLatency":0},{"appLabel":"uc_browser","sslConLatency":0},{"appLabel":"office365","sslConLatency":0},{"appLabel":"bytedance","sslConLatency":0},{"appLabel":"alibaba_cloud","sslConLatency":0},{"appLabel":"pinduoduo","sslConLatency":0},{"appLabel":"alibaba_group","sslConLatency":0},{"appLabel":"chinanetcenter","sslConLatency":0},{"appLabel":"sina_weibo","sslConLatency":0},{"appLabel":"xiaohongshu","sslConLatency":0},{"appLabel":"netease_cloud_music","sslConLatency":0}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(avg_ssl_con_latency_ms), 4) AS ssl_con_latency FROM metric_application WHERE stat_time >= toDateTime(1677224704) AND stat_time < toDateTime(1677228304) AND isNotNull(avg_ssl_con_latency_ms) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScorePacketRetransPercent = { "data": {"status":200,"code":200,"queryKey":"24535df333204235130f9866135b8476","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":12982,"bytes_read":434570,"result_size":2185,"result_rows":44},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"pkt_retrans_percent","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","pktRetransPercent":0.0535},{"appLabel":"uplive","pktRetransPercent":0.0034},{"appLabel":"xiaomi","pktRetransPercent":0.0382},{"appLabel":"qq_web","pktRetransPercent":0.0587},{"appLabel":"mpegts","pktRetransPercent":0.0114},{"appLabel":"kuaishou","pktRetransPercent":0.0488},{"appLabel":"iperf","pktRetransPercent":0.0048},{"appLabel":"mango_tv","pktRetransPercent":0.0193},{"appLabel":"youku","pktRetransPercent":0.0145},{"appLabel":"huawei","pktRetransPercent":0.0116},{"appLabel":"ximalaya","pktRetransPercent":0.0159},{"appLabel":"bilibili","pktRetransPercent":0.0145},{"appLabel":"ixigua","pktRetransPercent":0.0507},{"appLabel":"mitalk","pktRetransPercent":0.0291},{"appLabel":"163com","pktRetransPercent":0.0154},{"appLabel":"meitu","pktRetransPercent":0.0189},{"appLabel":"tencent","pktRetransPercent":0.0229},{"appLabel":"netease","pktRetransPercent":0.0724},{"appLabel":"http2","pktRetransPercent":0.0298},{"appLabel":"flash","pktRetransPercent":0.0108},{"appLabel":"jingdong","pktRetransPercent":0.0132},{"appLabel":"douyin","pktRetransPercent":0.0313},{"appLabel":"baidu","pktRetransPercent":0.0356},{"appLabel":"taobao","pktRetransPercent":0.0081},{"appLabel":"appstore","pktRetransPercent":6.0E-4},{"appLabel":"toutiao","pktRetransPercent":0.0526},{"appLabel":"cibn","pktRetransPercent":0.0153},{"appLabel":"iqiyi","pktRetransPercent":0.0239},{"appLabel":"bmff","pktRetransPercent":0.0321},{"appLabel":"kugou","pktRetransPercent":0.0395},{"appLabel":"wechat","pktRetransPercent":0.0923},{"appLabel":"windows_update","pktRetransPercent":0.0159},{"appLabel":"gaode_map","pktRetransPercent":0.0404},{"appLabel":"uc_browser","pktRetransPercent":0.04},{"appLabel":"office365","pktRetransPercent":0.0051},{"appLabel":"bytedance","pktRetransPercent":0.0145},{"appLabel":"bittorrent","pktRetransPercent":0.0454},{"appLabel":"alibaba_cloud","pktRetransPercent":0.0135},{"appLabel":"pinduoduo","pktRetransPercent":0.0247},{"appLabel":"alibaba_group","pktRetransPercent":0.032},{"appLabel":"chinanetcenter","pktRetransPercent":0.0119},{"appLabel":"sina_weibo","pktRetransPercent":0.0328},{"appLabel":"xiaohongshu","pktRetransPercent":0.0148},{"appLabel":"netease_cloud_music","pktRetransPercent":0.0558}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(pkt_retrans_ratio), 4) AS pkt_retrans_percent FROM metric_application WHERE stat_time >= toDateTime(1677224704) AND stat_time < toDateTime(1677228304) AND isNotNull(pkt_retrans_ratio) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScoreTcpLostlenPercent = { "data": {"status":200,"code":200,"queryKey":"8fb0fc82b2c87b751b3abec5e3544e47","success":true,"message":null,"statistics":{"elapsed":3,"rows_read":12982,"bytes_read":434570,"result_size":2164,"result_rows":44},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"tcp_lostlen_percent","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","tcpLostlenPercent":0.0053},{"appLabel":"uplive","tcpLostlenPercent":0},{"appLabel":"xiaomi","tcpLostlenPercent":0.0084},{"appLabel":"qq_web","tcpLostlenPercent":0.0088},{"appLabel":"mpegts","tcpLostlenPercent":6.0E-4},{"appLabel":"kuaishou","tcpLostlenPercent":0.0073},{"appLabel":"iperf","tcpLostlenPercent":0.0058},{"appLabel":"mango_tv","tcpLostlenPercent":0.0055},{"appLabel":"youku","tcpLostlenPercent":0.0068},{"appLabel":"huawei","tcpLostlenPercent":0.0026},{"appLabel":"ximalaya","tcpLostlenPercent":0.0015},{"appLabel":"bilibili","tcpLostlenPercent":0.01},{"appLabel":"ixigua","tcpLostlenPercent":0.0174},{"appLabel":"mitalk","tcpLostlenPercent":0},{"appLabel":"163com","tcpLostlenPercent":0},{"appLabel":"meitu","tcpLostlenPercent":0.0045},{"appLabel":"tencent","tcpLostlenPercent":0.0045},{"appLabel":"netease","tcpLostlenPercent":4.0E-4},{"appLabel":"http2","tcpLostlenPercent":0.007},{"appLabel":"flash","tcpLostlenPercent":0.0101},{"appLabel":"jingdong","tcpLostlenPercent":0.0041},{"appLabel":"douyin","tcpLostlenPercent":0.0104},{"appLabel":"baidu","tcpLostlenPercent":0.0073},{"appLabel":"taobao","tcpLostlenPercent":0.0045},{"appLabel":"appstore","tcpLostlenPercent":0.0283},{"appLabel":"toutiao","tcpLostlenPercent":6.0E-4},{"appLabel":"cibn","tcpLostlenPercent":0.0054},{"appLabel":"iqiyi","tcpLostlenPercent":0.0016},{"appLabel":"bmff","tcpLostlenPercent":0.008},{"appLabel":"kugou","tcpLostlenPercent":0.0208},{"appLabel":"wechat","tcpLostlenPercent":0.0063},{"appLabel":"windows_update","tcpLostlenPercent":0.0042},{"appLabel":"gaode_map","tcpLostlenPercent":0},{"appLabel":"uc_browser","tcpLostlenPercent":0.0011},{"appLabel":"office365","tcpLostlenPercent":0.0011},{"appLabel":"bytedance","tcpLostlenPercent":0.0096},{"appLabel":"bittorrent","tcpLostlenPercent":0.0084},{"appLabel":"alibaba_cloud","tcpLostlenPercent":0.0043},{"appLabel":"pinduoduo","tcpLostlenPercent":0.0059},{"appLabel":"alibaba_group","tcpLostlenPercent":0.0026},{"appLabel":"chinanetcenter","tcpLostlenPercent":0.0032},{"appLabel":"sina_weibo","tcpLostlenPercent":0.0021},{"appLabel":"xiaohongshu","tcpLostlenPercent":0.0058},{"appLabel":"netease_cloud_music","tcpLostlenPercent":6.0E-4}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(tcp_lostlen_ratio), 4) AS tcp_lostlen_percent FROM metric_application WHERE stat_time >= toDateTime(1677224704) AND stat_time < toDateTime(1677228304) AND isNotNull(tcp_lostlen_ratio) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScoreHttpResponseDelay = { "data": {"status":200,"code":200,"queryKey":"a22d7812f9faed42f14406c603f2d8b1","success":true,"message":null,"statistics":{"elapsed":3,"rows_read":12982,"bytes_read":434570,"result_size":2245,"result_rows":42},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"http_response_latency","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","httpResponseLatency":65.8873},{"appLabel":"uplive","httpResponseLatency":59.2162},{"appLabel":"xiaomi","httpResponseLatency":155.2906},{"appLabel":"qq_web","httpResponseLatency":113.7327},{"appLabel":"mpegts","httpResponseLatency":74.393},{"appLabel":"kuaishou","httpResponseLatency":385.5914},{"appLabel":"iperf","httpResponseLatency":125.3333},{"appLabel":"mango_tv","httpResponseLatency":545.9437},{"appLabel":"youku","httpResponseLatency":55.9517},{"appLabel":"huawei","httpResponseLatency":108.8767},{"appLabel":"ximalaya","httpResponseLatency":67.2947},{"appLabel":"bilibili","httpResponseLatency":113.9537},{"appLabel":"ixigua","httpResponseLatency":546.6292},{"appLabel":"mitalk","httpResponseLatency":51},{"appLabel":"163com","httpResponseLatency":146.1114},{"appLabel":"meitu","httpResponseLatency":390.7221},{"appLabel":"tencent","httpResponseLatency":562.1833},{"appLabel":"netease","httpResponseLatency":269.2048},{"appLabel":"flash","httpResponseLatency":80.7997},{"appLabel":"jingdong","httpResponseLatency":51.5389},{"appLabel":"douyin","httpResponseLatency":147.1872},{"appLabel":"baidu","httpResponseLatency":137.3964},{"appLabel":"taobao","httpResponseLatency":62.6976},{"appLabel":"toutiao","httpResponseLatency":211.3539},{"appLabel":"cibn","httpResponseLatency":114.5115},{"appLabel":"iqiyi","httpResponseLatency":100.5626},{"appLabel":"bmff","httpResponseLatency":293.3617},{"appLabel":"kugou","httpResponseLatency":183.6093},{"appLabel":"wechat","httpResponseLatency":150.4299},{"appLabel":"windows_update","httpResponseLatency":142.1594},{"appLabel":"gaode_map","httpResponseLatency":1082.5312},{"appLabel":"uc_browser","httpResponseLatency":498.1972},{"appLabel":"office365","httpResponseLatency":233.9082},{"appLabel":"bytedance","httpResponseLatency":185.3557},{"appLabel":"bittorrent","httpResponseLatency":578.7939},{"appLabel":"alibaba_cloud","httpResponseLatency":126.2049},{"appLabel":"pinduoduo","httpResponseLatency":1788.5914},{"appLabel":"alibaba_group","httpResponseLatency":194.3976},{"appLabel":"chinanetcenter","httpResponseLatency":177.1662},{"appLabel":"sina_weibo","httpResponseLatency":55.1753},{"appLabel":"xiaohongshu","httpResponseLatency":101.6416},{"appLabel":"netease_cloud_music","httpResponseLatency":430.9772}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(avg_http_response_latency_ms), 4) AS http_response_latency FROM metric_application WHERE stat_time >= toDateTime(1677224704) AND stat_time < toDateTime(1677228304) AND isNotNull(avg_http_response_latency_ms) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScoreTcpSessionDelayCycle = { "data": {"status":200,"code":200,"queryKey":"51c36b067aae8c9ce3a544062d9d1d3c","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":8192,"bytes_read":274195,"result_size":2277,"result_rows":44},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"establish_latency_ms","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","establishLatencyMs":52.0227},{"appLabel":"uplive","establishLatencyMs":57.1237},{"appLabel":"xiaomi","establishLatencyMs":162.0899},{"appLabel":"qq_web","establishLatencyMs":82.0772},{"appLabel":"mpegts","establishLatencyMs":71.1648},{"appLabel":"kuaishou","establishLatencyMs":153.9623},{"appLabel":"iperf","establishLatencyMs":93.5649},{"appLabel":"mango_tv","establishLatencyMs":93.977},{"appLabel":"youku","establishLatencyMs":83.5077},{"appLabel":"huawei","establishLatencyMs":78.5598},{"appLabel":"ximalaya","establishLatencyMs":52.4955},{"appLabel":"bilibili","establishLatencyMs":61.5685},{"appLabel":"ixigua","establishLatencyMs":66.1651},{"appLabel":"mitalk","establishLatencyMs":72.6713},{"appLabel":"163com","establishLatencyMs":128.0682},{"appLabel":"meitu","establishLatencyMs":56.8629},{"appLabel":"tencent","establishLatencyMs":213.9663},{"appLabel":"netease","establishLatencyMs":71.2493},{"appLabel":"http2","establishLatencyMs":91.948},{"appLabel":"flash","establishLatencyMs":67.2667},{"appLabel":"jingdong","establishLatencyMs":60.9477},{"appLabel":"douyin","establishLatencyMs":78.1607},{"appLabel":"baidu","establishLatencyMs":70.7046},{"appLabel":"taobao","establishLatencyMs":61.4626},{"appLabel":"appstore","establishLatencyMs":23.3},{"appLabel":"toutiao","establishLatencyMs":72.3915},{"appLabel":"cibn","establishLatencyMs":36.5924},{"appLabel":"iqiyi","establishLatencyMs":111.4572},{"appLabel":"bmff","establishLatencyMs":106.0877},{"appLabel":"kugou","establishLatencyMs":96.988},{"appLabel":"wechat","establishLatencyMs":94.9763},{"appLabel":"windows_update","establishLatencyMs":223.8323},{"appLabel":"gaode_map","establishLatencyMs":81.6277},{"appLabel":"uc_browser","establishLatencyMs":83.8552},{"appLabel":"office365","establishLatencyMs":58.2968},{"appLabel":"bytedance","establishLatencyMs":81.104},{"appLabel":"bittorrent","establishLatencyMs":874.1813},{"appLabel":"alibaba_cloud","establishLatencyMs":70.9071},{"appLabel":"pinduoduo","establishLatencyMs":85.4756},{"appLabel":"alibaba_group","establishLatencyMs":105.4614},{"appLabel":"chinanetcenter","establishLatencyMs":98.7178},{"appLabel":"sina_weibo","establishLatencyMs":60.8279},{"appLabel":"xiaohongshu","establishLatencyMs":61.516},{"appLabel":"netease_cloud_music","establishLatencyMs":92.2605}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(avg_establish_latency_ms), 4) AS establish_latency_ms FROM metric_application WHERE stat_time >= toDateTime(1677224704)-3600 AND stat_time < toDateTime(1677228304)-3600 AND isNotNull(avg_establish_latency_ms) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScoreSslConDelayCycle = { "data": {"status":200,"code":200,"queryKey":"95eb971572401d8f48341554d6adec34","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":8192,"bytes_read":274195,"result_size":1672,"result_rows":41},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"ssl_con_latency","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","sslConLatency":0},{"appLabel":"uplive","sslConLatency":0},{"appLabel":"xiaomi","sslConLatency":0},{"appLabel":"qq_web","sslConLatency":0},{"appLabel":"kuaishou","sslConLatency":0},{"appLabel":"iperf","sslConLatency":0},{"appLabel":"mango_tv","sslConLatency":0},{"appLabel":"youku","sslConLatency":0},{"appLabel":"huawei","sslConLatency":0},{"appLabel":"ximalaya","sslConLatency":0},{"appLabel":"bilibili","sslConLatency":0},{"appLabel":"ixigua","sslConLatency":0},{"appLabel":"mitalk","sslConLatency":0},{"appLabel":"163com","sslConLatency":0},{"appLabel":"meitu","sslConLatency":0},{"appLabel":"tencent","sslConLatency":0},{"appLabel":"netease","sslConLatency":0},{"appLabel":"http2","sslConLatency":0},{"appLabel":"jingdong","sslConLatency":0},{"appLabel":"douyin","sslConLatency":0},{"appLabel":"baidu","sslConLatency":0},{"appLabel":"taobao","sslConLatency":0},{"appLabel":"appstore","sslConLatency":0},{"appLabel":"toutiao","sslConLatency":0},{"appLabel":"cibn","sslConLatency":0},{"appLabel":"iqiyi","sslConLatency":0},{"appLabel":"bmff","sslConLatency":0},{"appLabel":"kugou","sslConLatency":0},{"appLabel":"wechat","sslConLatency":0},{"appLabel":"windows_update","sslConLatency":0},{"appLabel":"gaode_map","sslConLatency":0},{"appLabel":"uc_browser","sslConLatency":0},{"appLabel":"office365","sslConLatency":0},{"appLabel":"bytedance","sslConLatency":0},{"appLabel":"alibaba_cloud","sslConLatency":0},{"appLabel":"pinduoduo","sslConLatency":0},{"appLabel":"alibaba_group","sslConLatency":0},{"appLabel":"chinanetcenter","sslConLatency":0},{"appLabel":"sina_weibo","sslConLatency":0},{"appLabel":"xiaohongshu","sslConLatency":0},{"appLabel":"netease_cloud_music","sslConLatency":0}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(avg_ssl_con_latency_ms), 4) AS ssl_con_latency FROM metric_application WHERE stat_time >= toDateTime(1677224704)-3600 AND stat_time < toDateTime(1677228304)-3600 AND isNotNull(avg_ssl_con_latency_ms) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScorePacketRetransPercentCycle = { "data": {"status":200,"code":200,"queryKey":"245fb420ba7acc36daad95cf055593c7","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":8192,"bytes_read":274195,"result_size":2179,"result_rows":44},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"pkt_retrans_percent","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","pktRetransPercent":0.0596},{"appLabel":"uplive","pktRetransPercent":0},{"appLabel":"xiaomi","pktRetransPercent":0.0539},{"appLabel":"qq_web","pktRetransPercent":0.0578},{"appLabel":"mpegts","pktRetransPercent":0.0099},{"appLabel":"kuaishou","pktRetransPercent":0.0549},{"appLabel":"iperf","pktRetransPercent":0.0056},{"appLabel":"mango_tv","pktRetransPercent":0.0245},{"appLabel":"youku","pktRetransPercent":0.0211},{"appLabel":"huawei","pktRetransPercent":0.0182},{"appLabel":"ximalaya","pktRetransPercent":0.0074},{"appLabel":"bilibili","pktRetransPercent":0.02},{"appLabel":"ixigua","pktRetransPercent":0.0324},{"appLabel":"mitalk","pktRetransPercent":0.0206},{"appLabel":"163com","pktRetransPercent":0.0274},{"appLabel":"meitu","pktRetransPercent":0.0173},{"appLabel":"tencent","pktRetransPercent":0.0785},{"appLabel":"netease","pktRetransPercent":0.0685},{"appLabel":"http2","pktRetransPercent":0.0282},{"appLabel":"flash","pktRetransPercent":0.0295},{"appLabel":"jingdong","pktRetransPercent":0.0077},{"appLabel":"douyin","pktRetransPercent":0.0302},{"appLabel":"baidu","pktRetransPercent":0.0337},{"appLabel":"taobao","pktRetransPercent":0.0083},{"appLabel":"appstore","pktRetransPercent":6.0E-4},{"appLabel":"toutiao","pktRetransPercent":0.062},{"appLabel":"cibn","pktRetransPercent":0.0049},{"appLabel":"iqiyi","pktRetransPercent":0.0249},{"appLabel":"bmff","pktRetransPercent":0.0349},{"appLabel":"kugou","pktRetransPercent":0.0499},{"appLabel":"wechat","pktRetransPercent":0.095},{"appLabel":"windows_update","pktRetransPercent":0.0071},{"appLabel":"gaode_map","pktRetransPercent":0.0325},{"appLabel":"uc_browser","pktRetransPercent":0.0495},{"appLabel":"office365","pktRetransPercent":0.0021},{"appLabel":"bytedance","pktRetransPercent":0.0153},{"appLabel":"bittorrent","pktRetransPercent":0.0335},{"appLabel":"alibaba_cloud","pktRetransPercent":0.0135},{"appLabel":"pinduoduo","pktRetransPercent":0.0272},{"appLabel":"alibaba_group","pktRetransPercent":0.0443},{"appLabel":"chinanetcenter","pktRetransPercent":0.0086},{"appLabel":"sina_weibo","pktRetransPercent":0.0357},{"appLabel":"xiaohongshu","pktRetransPercent":0.0065},{"appLabel":"netease_cloud_music","pktRetransPercent":0.0608}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(pkt_retrans_ratio), 4) AS pkt_retrans_percent FROM metric_application WHERE stat_time >= toDateTime(1677224704)-3600 AND stat_time < toDateTime(1677228304)-3600 AND isNotNull(pkt_retrans_ratio) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScoreTcpLostlenPercentCycle = { "data": {"status":200,"code":200,"queryKey":"6ec5f2ef9e9bfd55f663ac533ec005de","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":8192,"bytes_read":274195,"result_size":2174,"result_rows":44},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"tcp_lostlen_percent","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","tcpLostlenPercent":0.0043},{"appLabel":"uplive","tcpLostlenPercent":0},{"appLabel":"xiaomi","tcpLostlenPercent":0.023},{"appLabel":"qq_web","tcpLostlenPercent":0.0076},{"appLabel":"mpegts","tcpLostlenPercent":0.0027},{"appLabel":"kuaishou","tcpLostlenPercent":0.0069},{"appLabel":"iperf","tcpLostlenPercent":0.007},{"appLabel":"mango_tv","tcpLostlenPercent":0.0038},{"appLabel":"youku","tcpLostlenPercent":0.0047},{"appLabel":"huawei","tcpLostlenPercent":0.0025},{"appLabel":"ximalaya","tcpLostlenPercent":0.0021},{"appLabel":"bilibili","tcpLostlenPercent":0.0166},{"appLabel":"ixigua","tcpLostlenPercent":0.0155},{"appLabel":"mitalk","tcpLostlenPercent":0.0021},{"appLabel":"163com","tcpLostlenPercent":0},{"appLabel":"meitu","tcpLostlenPercent":0.0029},{"appLabel":"tencent","tcpLostlenPercent":0.0034},{"appLabel":"netease","tcpLostlenPercent":3.0E-4},{"appLabel":"http2","tcpLostlenPercent":0.0149},{"appLabel":"flash","tcpLostlenPercent":0.005},{"appLabel":"jingdong","tcpLostlenPercent":0.0048},{"appLabel":"douyin","tcpLostlenPercent":0.0091},{"appLabel":"baidu","tcpLostlenPercent":0.0087},{"appLabel":"taobao","tcpLostlenPercent":0.0036},{"appLabel":"appstore","tcpLostlenPercent":0.0218},{"appLabel":"toutiao","tcpLostlenPercent":4.0E-4},{"appLabel":"cibn","tcpLostlenPercent":0.0087},{"appLabel":"iqiyi","tcpLostlenPercent":0.005},{"appLabel":"bmff","tcpLostlenPercent":0.0079},{"appLabel":"kugou","tcpLostlenPercent":0.0142},{"appLabel":"wechat","tcpLostlenPercent":0.0086},{"appLabel":"windows_update","tcpLostlenPercent":0.0022},{"appLabel":"gaode_map","tcpLostlenPercent":4.0E-4},{"appLabel":"uc_browser","tcpLostlenPercent":0.0046},{"appLabel":"office365","tcpLostlenPercent":0.0029},{"appLabel":"bytedance","tcpLostlenPercent":0.0085},{"appLabel":"bittorrent","tcpLostlenPercent":0.0139},{"appLabel":"alibaba_cloud","tcpLostlenPercent":0.0037},{"appLabel":"pinduoduo","tcpLostlenPercent":0.0063},{"appLabel":"alibaba_group","tcpLostlenPercent":0.0033},{"appLabel":"chinanetcenter","tcpLostlenPercent":0.0066},{"appLabel":"sina_weibo","tcpLostlenPercent":0.0052},{"appLabel":"xiaohongshu","tcpLostlenPercent":0.0084},{"appLabel":"netease_cloud_music","tcpLostlenPercent":2.0E-4}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(tcp_lostlen_ratio), 4) AS tcp_lostlen_percent FROM metric_application WHERE stat_time >= toDateTime(1677224704)-3600 AND stat_time < toDateTime(1677228304)-3600 AND isNotNull(tcp_lostlen_ratio) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
const mockGetScoreHttpResponseDelayCycle = { "data": {"status":200,"code":200,"queryKey":"a5089f743bce34d5507bb5735a1e1bb9","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":8192,"bytes_read":274195,"result_size":2239,"result_rows":42},"job":null,"formatType":"json","meta":[{"name":"app_label","type":"string","category":"Dimension"},{"name":"http_response_latency","type":"double","category":"Metric"}],"data":{"resultType":"table","result":[{"appLabel":"qqvideo","httpResponseLatency":58.3586},{"appLabel":"uplive","httpResponseLatency":58.3276},{"appLabel":"xiaomi","httpResponseLatency":255.5454},{"appLabel":"qq_web","httpResponseLatency":121.0739},{"appLabel":"mpegts","httpResponseLatency":73.4589},{"appLabel":"kuaishou","httpResponseLatency":415.5194},{"appLabel":"iperf","httpResponseLatency":122.8889},{"appLabel":"mango_tv","httpResponseLatency":483.2962},{"appLabel":"youku","httpResponseLatency":52.168},{"appLabel":"huawei","httpResponseLatency":109.4998},{"appLabel":"ximalaya","httpResponseLatency":56.2959},{"appLabel":"bilibili","httpResponseLatency":137.4569},{"appLabel":"ixigua","httpResponseLatency":63.9122},{"appLabel":"mitalk","httpResponseLatency":51},{"appLabel":"163com","httpResponseLatency":526.3931},{"appLabel":"meitu","httpResponseLatency":212.8459},{"appLabel":"tencent","httpResponseLatency":360.977},{"appLabel":"netease","httpResponseLatency":252.1966},{"appLabel":"flash","httpResponseLatency":116.1838},{"appLabel":"jingdong","httpResponseLatency":55.0174},{"appLabel":"douyin","httpResponseLatency":163.4641},{"appLabel":"baidu","httpResponseLatency":121.4797},{"appLabel":"taobao","httpResponseLatency":62.7715},{"appLabel":"toutiao","httpResponseLatency":226.9452},{"appLabel":"cibn","httpResponseLatency":65.2762},{"appLabel":"iqiyi","httpResponseLatency":88.4371},{"appLabel":"bmff","httpResponseLatency":313.0338},{"appLabel":"kugou","httpResponseLatency":144.8374},{"appLabel":"wechat","httpResponseLatency":215.028},{"appLabel":"windows_update","httpResponseLatency":302.4741},{"appLabel":"gaode_map","httpResponseLatency":121.5773},{"appLabel":"uc_browser","httpResponseLatency":268.5431},{"appLabel":"office365","httpResponseLatency":144.6031},{"appLabel":"bytedance","httpResponseLatency":165.572},{"appLabel":"bittorrent","httpResponseLatency":1288.7593},{"appLabel":"alibaba_cloud","httpResponseLatency":132.5711},{"appLabel":"pinduoduo","httpResponseLatency":1458.2452},{"appLabel":"alibaba_group","httpResponseLatency":244.2192},{"appLabel":"chinanetcenter","httpResponseLatency":100.6967},{"appLabel":"sina_weibo","httpResponseLatency":56.6954},{"appLabel":"xiaohongshu","httpResponseLatency":66.0377},{"appLabel":"netease_cloud_music","httpResponseLatency":326.9596}]},"originalUrl":"http://192.168.44.55:9999/?query= SELECT common_app_label AS app_label, ROUND(AVG(avg_http_response_latency_ms), 4) AS http_response_latency FROM metric_application WHERE stat_time >= toDateTime(1677224704)-3600 AND stat_time < toDateTime(1677228304)-3600 AND isNotNull(avg_http_response_latency_ms) AND app_label IN ( 'douyin','wechat','kuaishou','alibaba_cloud','bmff','netease_cloud_music','qq_web','wtls','bytedance','toutiao','pinduoduo','http2','baidu','netease','flash','kugou','sina_weibo','xiaomi','cibn','bittorrent','appstore','windows_update','iqiyi','ixigua','uc_browser','tencent','jingdong','iperf','office365','alibaba_group','experion','youku','xiaohongshu','taobao','uplive','qqvideo','mitalk','mpegts','huawei','bilibili','chinanetcenter','mango_tv','gaode_map','speedtest','ultrasurf','163com','mgcp','wsp','ximalaya','meitu' ) GROUP BY app_label &format=json&option=real-time","msg":"OK"}}
//DNS模块Qypes列
const mockGetDnsQTypes = { data: {"status":200,"code":200,"queryKey":"bb0ffaa439ecafcae5b1e7adc2ba6f4b","success":true,"message":null,"statistics":{"elapsed":2,"rows_read":2294,"bytes_read":149110,"result_size":1241,"result_rows":9},"job":null,"formatType":"json","meta":[{"name":"qtype","type":"long","category":"Dimension"},{"name":"query_num","type":"long","category":"Metric"},{"name":"total_internal_query_num","type":"long","category":"Metric"},{"name":"total_external_query_num","type":"long","category":"Metric"},{"name":"dns_response_latency_avg","type":"double","category":"Metric"},{"name":"total_bytes","type":"long","category":"Metric"}],"data":{"resultType":"table","result":[{"qtype":"0","queryNum":"229365","queryRate":63.71,"totalInternalQueryNum":"228537","totalExternalQueryNum":"828","dnsResponseLatencyAvg":38.2818,"totalBytes":"29604599","totalBitsRate":65788.0},{"qtype":"1","queryNum":"15944","queryRate":4.43,"totalInternalQueryNum":"15836","totalExternalQueryNum":"108","dnsResponseLatencyAvg":66.3829,"totalBytes":"37137","totalBitsRate":82.56},{"qtype":"28","queryNum":"5537","queryRate":1.54,"totalInternalQueryNum":"5508","totalExternalQueryNum":"29","dnsResponseLatencyAvg":112.7023,"totalBytes":"20010","totalBitsRate":44.48},{"qtype":"33","queryNum":"141","queryRate":0.04,"totalInternalQueryNum":"141","totalExternalQueryNum":"0","dnsResponseLatencyAvg":61.2329,"totalBytes":"11222","totalBitsRate":24.96},{"qtype":"65","queryNum":"170","queryRate":0.05,"totalInternalQueryNum":"134","totalExternalQueryNum":"36","dnsResponseLatencyAvg":302.7225,"totalBytes":"7687","totalBitsRate":17.12},{"qtype":"12","queryNum":"315","queryRate":0.09,"totalInternalQueryNum":"307","totalExternalQueryNum":"8","dnsResponseLatencyAvg":345.1078,"totalBytes":"6398","totalBitsRate":14.24},{"qtype":"5","queryNum":"25","queryRate":0.01,"totalInternalQueryNum":"25","totalExternalQueryNum":"0","dnsResponseLatencyAvg":54.5,"totalBytes":"3073","totalBitsRate":6.8},{"qtype":"16","queryNum":"26","queryRate":0.01,"totalInternalQueryNum":"26","totalExternalQueryNum":"0","dnsResponseLatencyAvg":50.3333,"totalBytes":"896","totalBitsRate":2.0},{"qtype":"2","queryNum":"2","queryRate":0.0,"totalInternalQueryNum":"2","totalExternalQueryNum":"0","dnsResponseLatencyAvg":45.5,"totalBytes":"592","totalBitsRate":1.28}]},"originalUrl":"http://192.168.44.55:9999/?query=SELECT qtype AS qtype, SUM(query_num) AS query_num, SUM(internal_query_num) AS total_internal_query_num, SUM(external_query_num) AS total_external_query_num, ROUND(AVG(avg_response_latency_ms),4) AS dns_response_latency_avg, SUM(traffic_inbound_byte + traffic_outbound_byte) AS total_bytes FROM metric_dns_qtype WHERE stat_time >= toDateTime(1677304830) AND stat_time < toDateTime(1677308430) GROUP BY qtype ORDER BY total_bytes desc LIMIT 50 &format=json&option=real-time","msg":"OK"}}
const mockGetDnsQTypesCycle = { data: {"status":200,"code":200,"queryKey":"8164c38e9cb012b44b72bcb9df2495e0","success":true,"message":null,"statistics":{"elapsed":1,"rows_read":2294,"bytes_read":112406,"result_size":710,"result_rows":9},"job":null,"formatType":"json","meta":[{"name":"qtype","type":"long","category":"Dimension"},{"name":"query_num","type":"long","category":"Metric"},{"name":"dns_response_latency_avg","type":"double","category":"Metric"},{"name":"total_bytes","type":"long","category":"Metric"}],"data":{"resultType":"table","result":[{"qtype":"0","queryNum":"234705","queryRate":65.2,"dnsResponseLatencyAvg":37.9805,"totalBytes":"29712991","totalBitsRate":66028.88},{"qtype":"2","queryNum":"4","queryRate":0.0,"dnsResponseLatencyAvg":23,"totalBytes":"1522","totalBitsRate":3.36},{"qtype":"5","queryNum":"16","queryRate":0.0,"dnsResponseLatencyAvg":37.2564,"totalBytes":"3349","totalBitsRate":7.44},{"qtype":"1","queryNum":"16667","queryRate":4.63,"dnsResponseLatencyAvg":63.652,"totalBytes":"33594","totalBitsRate":74.64},{"qtype":"65","queryNum":"174","queryRate":0.05,"dnsResponseLatencyAvg":332.1654,"totalBytes":"8606","totalBitsRate":19.12},{"qtype":"28","queryNum":"5472","queryRate":1.52,"dnsResponseLatencyAvg":105.5314,"totalBytes":"17670","totalBitsRate":39.28},{"qtype":"16","queryNum":"19","queryRate":0.01,"dnsResponseLatencyAvg":47.381,"totalBytes":"999","totalBitsRate":2.24},{"qtype":"12","queryNum":"95","queryRate":0.03,"dnsResponseLatencyAvg":652.0599,"totalBytes":"4353","totalBitsRate":9.68},{"qtype":"33","queryNum":"158","queryRate":0.04,"dnsResponseLatencyAvg":54.3488,"totalBytes":"10475","totalBitsRate":23.28}]},"originalUrl":"http://192.168.44.55:9999/?query=SELECT qtype AS qtype, SUM(query_num) AS query_num, ROUND(AVG(avg_response_latency_ms),4) AS dns_response_latency_avg, SUM(traffic_inbound_byte + traffic_outbound_byte) AS total_bytes FROM metric_dns_qtype WHERE stat_time >= toDateTime(1677304830)-3600 AND stat_time < toDateTime(1677308430)-3600 AND qtype IN( '0','1','28','33','65','12','5','16','2' ) GROUP BY qtype&format=json&option=real-time","msg":"OK"}}
const mockGetDnsQTypesDict = { data: {"code":200,"data":{"total":97,"pageSize":-1,"pages":1,"pageNo":1,"list":[{"id":5632,"name":"DNS qtype","type":"dnsQtype","code":"8","value":"MG","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5633,"name":"DNS qtype","type":"dnsQtype","code":"9","value":"MR","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5634,"name":"DNS qtype","type":"dnsQtype","code":"10","value":"NULL","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5635,"name":"DNS qtype","type":"dnsQtype","code":"11","value":"WKS","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5636,"name":"DNS qtype","type":"dnsQtype","code":"12","value":"PTR","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5637,"name":"DNS qtype","type":"dnsQtype","code":"13","value":"HINFO","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5638,"name":"DNS qtype","type":"dnsQtype","code":"14","value":"MINFO","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5639,"name":"DNS qtype","type":"dnsQtype","code":"15","value":"MX","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5640,"name":"DNS qtype","type":"dnsQtype","code":"16","value":"TXT","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"build
//DNS模块RCodes列
const mockGetDnsRCodes = { data: {"status":200,"code":200,"queryKey":"0895e2bdf85b8758d4b52774dc8dcace","success":true,"message":null,"statistics":{"elapsed":363,"rows_read":449,"bytes_read":29185,"result_size":687,"result_rows":5},"job":null,"formatType":"json","meta":[{"name":"rcode","type":"long","category":"Dimension"},{"name":"query_num","type":"long","category":"Metric"},{"name":"total_internal_query_num","type":"long","category":"Metric"},{"name":"total_external_query_num","type":"long","category":"Metric"},{"name":"dns_response_latency_avg","type":"double","category":"Metric"},{"name":"total_bytes","type":"long","category":"Metric"}],"data":{"resultType":"table","result":[{"rcode":"0","queryNum":"242600","queryRate":67.39,"totalInternalQueryNum":"241720","totalExternalQueryNum":"880","dnsResponseLatencyAvg":45.7425,"totalBytes":"29094099","totalBitsRate":64653.52},{"rcode":"3","queryNum":"1512","queryRate":0.42,"totalInternalQueryNum":"1476","totalExternalQueryNum":"36","dnsResponseLatencyAvg":77.3129,"totalBytes":"20175","totalBitsRate":44.8},{"rcode":"5","queryNum":"144","queryRate":0.04,"totalInternalQueryNum":"89","totalExternalQueryNum":"55","dnsResponseLatencyAvg":94.4913,"totalBytes":"6529","totalBitsRate":14.48},{"rcode":"2","queryNum":"575","queryRate":0.16,"totalInternalQueryNum":"573","totalExternalQueryNum":"2","dnsResponseLatencyAvg":1807.2043,"totalBytes":"5659","totalBitsRate":12.56},{"rcode":"4","queryNum":"2","queryRate":0.0,"totalInternalQueryNum":"2","totalExternalQueryNum":"0","dnsResponseLatencyAvg":71,"totalBytes":"77","totalBitsRate":0.16}]},"originalUrl":"http://192.168.44.55:9999/?query=SELECT rcode AS rcode, SUM(query_num) AS query_num, SUM(internal_query_num) AS total_internal_query_num, SUM(external_query_num) AS total_external_query_num, ROUND(AVG(avg_response_latency_ms),4) AS dns_response_latency_avg, SUM(traffic_inbound_byte + traffic_outbound_byte) AS total_bytes FROM metric_dns_rcode WHERE stat_time >= toDateTime(1677200319) AND stat_time < toDateTime(1677203919) GROUP BY rcode ORDER BY total_bytes desc LIMIT 50 &format=json&option=real-time","msg":"OK"} }
const mockGetDnsRCodesCycle = { data: {"status":200,"code":200,"queryKey":"6f6568746dd7ddfe88ae3165bb7be5cf","success":true,"message":null,"statistics":{"elapsed":46,"rows_read":454,"bytes_read":22246,"result_size":396,"result_rows":5},"job":null,"formatType":"json","meta":[{"name":"rcode","type":"long","category":"Dimension"},{"name":"query_num","type":"long","category":"Metric"},{"name":"dns_response_latency_avg","type":"double","category":"Metric"},{"name":"total_bytes","type":"long","category":"Metric"}],"data":{"resultType":"table","result":[{"rcode":"0","queryNum":"258775","queryRate":71.88,"dnsResponseLatencyAvg":40.2086,"totalBytes":"31109812","totalBitsRate":69132.88},{"rcode":"4","queryNum":"3","queryRate":0.0,"dnsResponseLatencyAvg":75.25,"totalBytes":"157","totalBitsRate":0.32},{"rcode":"3","queryNum":"1409","queryRate":0.39,"dnsResponseLatencyAvg":76.1114,"totalBytes":"24481","totalBitsRate":54.4},{"rcode":"2","queryNum":"503","queryRate":0.14,"dnsResponseLatencyAvg":1784.9738,"totalBytes":"5299","totalBitsRate":11.76},{"rcode":"5","queryNum":"147","queryRate":0.04,"dnsResponseLatencyAvg":93.1845,"totalBytes":"7175","totalBitsRate":15.92}]},"originalUrl":"http://192.168.44.55:9999/?query=SELECT rcode AS rcode, SUM(query_num) AS query_num, ROUND(AVG(avg_response_latency_ms),4) AS dns_response_latency_avg, SUM(traffic_inbound_byte + traffic_outbound_byte) AS total_bytes FROM metric_dns_rcode WHERE stat_time >= toDateTime(1677200319)-3600 AND stat_time < toDateTime(1677203919)-3600 AND rcode IN( '0','3','5','2','4' ) GROUP BY rcode&format=json&option=real-time","msg":"OK"} }
const mockGetDnsRCodesDict = { data: {"code":200,"data":{"total":25,"pageSize":-1,"pages":1,"pageNo":1,"list":[{"id":5599,"name":"DNS rcode","type":"dnsRcode","code":"0","value":"NoError","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5600,"name":"DNS rcode","type":"dnsRcode","code":"1","value":"FormErr","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5601,"name":"DNS rcode","type":"dnsRcode","code":"2","value":"ServFail","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5602,"name":"DNS rcode","type":"dnsRcode","code":"3","value":"NXDomain","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5603,"name":"DNS rcode","type":"dnsRcode","code":"4","value":"NotImp","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5604,"name":"DNS rcode","type":"dnsRcode","code":"5","value":"Refused","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5605,"name":"DNS rcode","type":"dnsRcode","code":"6","value":"YXDomain","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5606,"name":"DNS rcode","type":"dnsRcode","code":"7","value":"YXRRSet","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"status":null,"source":null,"buildIn":null,"roleIds":null,"usergroupIds":null,"roles":null,"apiKeyId":null}},{"id":5607,"name":"DNS rcode","type":"dnsRcode","code":"8","value":"NXRRSet","sort":0,"remark":"","uby":1,"utime":"2022-11-02 16:11:07","i18n":"en","state":1,"buildIn":0,"uuser":{"id":1,"name":null,"username":"admin","salt":null,"lang":null,"theme":null,"lastLoginIp":null,"lastLoginTime":null,"ctime":null,"cby":null,"email":null,"mobile":null,"stat
function initIndexedDbData() {
// 模拟indexedDB的内容
indexedDBUtils.selectTable.mockReturnValue({
put: jest.fn(),
get: jest.fn((Obj) => {
if(Obj.id === "default") {
return drilldownTableConfig
} else {
return drilldownTableConfigUserSelf
}
}),
delete: jest.fn()
})
}
function initMuiltUrlData() {
// 测试内容有多个url不同的axios请求的话需分开写
axios.get.mockImplementation((url,params) => {
if(params.cycle === 1){
url = url + 'Cycle'
}
if(params.params.type === 'rcode' || params.params.type === 'qtype'){
url = url + params.params.type
}
if((params.params && params.params.type === 'dnsRcode') || (params.params && params.params.type === 'dnsQtype')){
url = url + params.params.type
}
switch (url) {
case '/interface/application/performance/overview/dimensionTrafficAnalysis':
return Promise.resolve(mockGetScore)
case '/interface/application/performance/overview/dimensionCycleTrafficAnalysis':
return Promise.resolve(mockGetScoreCycle)
/*1-5 计算分数*/
case '/interface/application/performance/overview/dimensionTcpSessionDelay':
return Promise.resolve(mockGetScoreTcpSessionDelay)
case '/interface/application/performance/overview/dimensionSslConDelay':
return Promise.resolve(mockGetScoreSslConDelay)
case '/interface/application/performance/overview/dimensionPacketRetransPercent':
return Promise.resolve(mockGetScorePacketRetransPercent)
case '/interface/application/performance/overview/dimensionTcpLostlenPercent':
return Promise.resolve(mockGetScoreTcpLostlenPercent)
case '/interface/application/performance/overview/dimensionHttpResponseDelay':
return Promise.resolve(mockGetScoreHttpResponseDelay)
/*上一周期的数据*/
case '/interface/application/performance/overview/dimensionTcpSessionDelayCycle':
return Promise.resolve(mockGetScoreTcpSessionDelayCycle)
case '/interface/application/performance/overview/dimensionSslConDelayCycle':
return Promise.resolve(mockGetScoreSslConDelayCycle)
case '/interface/application/performance/overview/dimensionPacketRetransPercentCycle':
return Promise.resolve(mockGetScorePacketRetransPercentCycle)
case '/interface/application/performance/overview/dimensionTcpLostlenPercentCycle':
return Promise.resolve(mockGetScoreTcpLostlenPercentCycle)
case '/interface/application/performance/overview/dimensionHttpResponseDelayCycle':
return Promise.resolve(mockGetScoreHttpResponseDelayCycle)
case '/interface/dns/overview/dimensionAnalysisqtype':
return Promise.resolve(mockGetDnsQTypes)
case '/interface/dns/overview/dimensionCycleAnalysisqtype':
return Promise.resolve(mockGetDnsQTypesCycle)
case '/interface/dns/overview/dimensionAnalysisrcode':
return Promise.resolve(mockGetDnsRCodes)
case '/interface/dns/overview/dimensionCycleAnalysisrcode':
return Promise.resolve(mockGetDnsRCodesCycle)
case '/sys/dictdnsQtype':
return Promise.resolve(mockGetDnsQTypesDict)
case '/sys/dictdnsRcode':
return Promise.resolve(mockGetDnsRCodesDict)
}
})
}
const store = createStore({
state() {
return { dnsQtypeMapData: [], dnsRcodeMapData:[]}
},
mutations: {
setDnsQtypeMapData (state, dnsQtypeMapData) {
state.dnsQtypeMapData = dnsQtypeMapData
},
setDnsRcodeMapData (state, dnsRcodeMapData) {
state.dnsRcodeMapData = dnsRcodeMapData
},
}
})
describe('views/charts2/charts/networkOverview/NetworkOverviewTabs.vue测试', () => {
test('Npm 下钻表格:评分列 数值验证', async () => {//需要模拟Index DB
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟indexedDB的内容
initIndexedDbData()
// 模拟 axios 数据
initMuiltUrlData()
// 加载vue组件获得实例
const wrapper = mount(NetworkOverviewTabs, {
global: {
plugins: [ElementPlus],
mocks:{
$route: {
query: {
curTab: 'appLabel',
tabOperationBeforeType: '5',
tabOperationType: '5',
tableShowMore:10
},
params: {
typeName: 'networkAppPerformance'
}
}
}
},
propsData: {
timeFilter:timeFilterScore
}
})
await new Promise(resolve => setTimeout(async () => {
// 分数列
const textNode0 = await wrapper.find('[test-id="score-0"]')
const textNode1 = await wrapper.find('[test-id="score-1"]')
const textNode2 = await wrapper.find('[test-id="score-2"]')
const textNode3 = await wrapper.find('[test-id="score-3"]')
const textNode4 = await wrapper.find('[test-id="score-4"]')
const textNode5 = await wrapper.find('[test-id="score-5"]')
const textNode6 = await wrapper.find('[test-id="score-6"]')
const textNode7 = await wrapper.find('[test-id="score-7"]')
const textNode8 = await wrapper.find('[test-id="score-8"]')
const textNode9 = await wrapper.find('[test-id="score-9"]')
expect(textNode0.text()).toBe('5')
expect(textNode1.text()).toBe('4')
expect(textNode2.text()).toBe('3')
expect(textNode3.text()).toBe('6')
expect(textNode4.text()).toBe('5')
expect(textNode5.text()).toBe('4')
expect(textNode6.text()).toBe('4')
2023-03-01 09:33:43 +08:00
expect(textNode7 === null)
2023-02-28 11:49:13 +08:00
expect(textNode8.text()).toBe('6')
expect(textNode9.text()).toBe('4')
resolve()
2023-03-01 09:33:43 +08:00
}, 200))
2023-02-28 11:49:13 +08:00
})
test('Npm 下钻表格:评分列 图标颜色验证', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟indexedDB的内容
initIndexedDbData()
// 模拟 axios 数据
initMuiltUrlData()
// 加载vue组件获得实例
const wrapper = mount(NetworkOverviewTabs, {
global: {
plugins: [ElementPlus],
mocks:{
$route: {
query: {
curTab: 'appLabel',
tabOperationBeforeType: '5',
tabOperationType: '5',
tableShowMore:10
},
params: {
typeName: 'networkAppPerformance'
}
}
}
},
propsData: {
timeFilter:timeFilterScore
}
})
await new Promise(resolve => setTimeout(async () => {
const textNode0 = await wrapper.find('[test-id="score-0"]')
const textNode1 = await wrapper.find('[test-id="score-1"]')
const textNode2 = await wrapper.find('[test-id="score-2"]')
const textNode3 = await wrapper.find('[test-id="score-3"]')
const textNode4 = await wrapper.find('[test-id="score-4"]')
const textNode5 = await wrapper.find('[test-id="score-5"]')
const textNode6 = await wrapper.find('[test-id="score-6"]')
const textNode7 = await wrapper.find('[test-id="score-7"]')
const textNode8 = await wrapper.find('[test-id="score-8"]')
const textNode9 = await wrapper.find('[test-id="score-9"]')
expect(textNode0.classes().indexOf('data-score-green')).toBeGreaterThan(-1)
expect(textNode1.classes().indexOf('data-score-yellow')).toBeGreaterThan(-1)
expect(textNode2.classes().indexOf('data-score-yellow')).toBeGreaterThan(-1)
expect(textNode3.classes().indexOf('data-score-green')).toBeGreaterThan(-1)
expect(textNode4.classes().indexOf('data-score-green')).toBeGreaterThan(-1)
expect(textNode5.classes().indexOf('data-score-yellow')).toBeGreaterThan(-1)
expect(textNode6.classes().indexOf('data-score-yellow')).toBeGreaterThan(-1)
2023-03-01 09:33:43 +08:00
expect(textNode7 === null)
2023-02-28 11:49:13 +08:00
expect(textNode8.classes().indexOf('data-score-green')).toBeGreaterThan(-1)
expect(textNode9.classes().indexOf('data-score-yellow')).toBeGreaterThan(-1)
resolve()
}, 200))
})
test('NetworkOverview 下钻表格chainRatio列 图标验证(上升图标、下降图标、持平图标、无图标)', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
initMuiltUrlData()
// 模拟indexedDB的内容
initIndexedDbData()
// 加载vue组件获得实例
const wrapper = mount(NetworkOverviewTabs, {
global: {
plugins: [ElementPlus],
mocks:{
$route: {
query: {
curTab: 'appLabel',
tabOperationBeforeType: '5',
tabOperationType: '5',
tableShowMore:10
},
params: {
typeName: 'networkAppPerformance'
}
}
}
},
propsData: {
timeFilter
}
})
await new Promise(resolve => setTimeout(() => {
//背景色验证:重传率列
const trendNode0 = wrapper.find('[test-id="data-trend-totalBytes0"]')
const trendNode1 = wrapper.find('[test-id="data-trend-totalBytes1"]')
const trendNode2 = wrapper.find('[test-id="data-trend-totalBytes2"]')
const trendNode3 = wrapper.find('[test-id="data-trend-totalBytes3"]')
const trendNode4 = wrapper.find('[test-id="data-trend-totalBytes4"]')
const trendNode5 = wrapper.find('[test-id="data-trend-totalBytes5"]')
const trendNode6 = wrapper.find('[test-id="data-trend-totalBytes6"]')
const trendNode7 = wrapper.find('[test-id="data-trend-totalBytes7"]')
const trendNode8 = wrapper.find('[test-id="data-trend-totalBytes8"]')
const trendNode9 = wrapper.find('[test-id="data-trend-totalBytes9"]')
expect(trendNode0.classes().indexOf('data-total-trend-green')).toBeGreaterThan(-1)
expect(trendNode1.classes().indexOf('data-total-trend-red')).toBeGreaterThan(-1)
expect(trendNode2.classes().indexOf('data-total-trend-red')).toBeGreaterThan(-1)
expect(trendNode3.classes().indexOf('data-total-trend-red')).toBeGreaterThan(-1)
expect(trendNode4.classes().indexOf('data-total-trend-red')).toBeGreaterThan(-1)
expect(trendNode5.classes().indexOf('data-total-trend-red')).toBeGreaterThan(-1)
expect(trendNode6.classes().indexOf('data-total-trend-green')).toBeGreaterThan(-1)
expect(trendNode7.classes().indexOf('data-total-trend-red')).toBeGreaterThan(-1)
//expect(trendNode7.text()).toBe('-')
expect(trendNode8.classes().indexOf('data-total-trend-green')).toBeGreaterThan(-1)
expect(trendNode9.classes().indexOf('data-total-trend-red')).toBeGreaterThan(-1)
//图标验证
const iconNode0 = wrapper.find('[test-id="data-trend-icon-totalBytes0"]')
const iconNode1 = wrapper.find('[test-id="data-trend-icon-totalBytes1"]')
const iconNode2 = wrapper.find('[test-id="data-trend-icon-totalBytes2"]')
const iconNode3 = wrapper.find('[test-id="data-trend-icon-totalBytes3"]')
const iconNode4 = wrapper.find('[test-id="data-trend-icon-totalBytes4"]')
const iconNode5 = wrapper.find('[test-id="data-trend-icon-totalBytes5"]')
const iconNode6 = wrapper.find('[test-id="data-trend-icon-totalBytes6"]')
const iconNode7 = wrapper.find('[test-id="data-trend-icon-totalBytes7"]')
const iconNode8 = wrapper.find('[test-id="data-trend-icon-totalBytes8"]')
const iconNode9 = wrapper.find('[test-id="data-trend-icon-totalBytes9"]')
expect(iconNode0.classes().indexOf('cn-icon-decline')).toBeGreaterThan(-1)
expect(iconNode1.classes().indexOf('cn-icon-rise1')).toBeGreaterThan(-1)
expect(iconNode2.classes().indexOf('cn-icon-rise1')).toBeGreaterThan(-1)
expect(iconNode3.classes().indexOf('cn-icon-rise1')).toBeGreaterThan(-1)
expect(iconNode4.classes().indexOf('cn-icon-rise1')).toBeGreaterThan(-1)
expect(iconNode5.classes().indexOf('cn-icon-rise1')).toBeGreaterThan(-1)
expect(iconNode6.classes().indexOf('cn-icon-decline')).toBeGreaterThan(-1)
expect(iconNode7.classes().indexOf('cn-icon-rise1')).toBeGreaterThan(-1)
//expect(iconNode7 === null)
expect(iconNode8.classes().indexOf('cn-icon-decline')).toBeGreaterThan(-1)
expect(iconNode9.classes().indexOf('cn-icon-rise1')).toBeGreaterThan(-1)
//数据验证
const textNode0 = wrapper.find('[test-id="data-trend-value-totalBytes0"]')
const textNode1 = wrapper.find('[test-id="data-trend-value-totalBytes1"]')
const textNode2 = wrapper.find('[test-id="data-trend-value-totalBytes2"]')
const textNode3 = wrapper.find('[test-id="data-trend-value-totalBytes3"]')
const textNode4 = wrapper.find('[test-id="data-trend-value-totalBytes4"]')
const textNode5 = wrapper.find('[test-id="data-trend-value-totalBytes5"]')
const textNode6 = wrapper.find('[test-id="data-trend-value-totalBytes6"]')
const textNode7 = wrapper.find('[test-id="data-trend-value-totalBytes7"]')
const textNode8 = wrapper.find('[test-id="data-trend-value-totalBytes8"]')
const textNode9 = wrapper.find('[test-id="data-trend-value-totalBytes9"]')
expect(textNode0.text()).toBe('0.72%')
expect(textNode1.text()).toBe('5.20%')
expect(textNode2.text()).toBe('2.13%')
expect(textNode3.text()).toBe('1.83%')
//expect(textNode3 === null)
expect(textNode4.text()).toBe('18.32%')
expect(textNode5.text()).toBe('0.18%')
expect(textNode6.text()).toBe('16.67%')
expect(textNode7.text()).toBe('15.69%')
//expect(textNode7 === null)
expect(textNode8.text()).toBe('37.95%')
expect(textNode9.text()).toBe('14.72%')
resolve()
}, 200))
})
test('DNS服务洞察 下钻表格:百分比列 横向柱状图绿色和黄色的百分比 及 数据显示 验证)', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
initMuiltUrlData()
// 模拟indexedDB的内容
initIndexedDbData()
// 加载vue组件获得实例
const wrapper = mount(NetworkOverviewTabs, {
global: {
plugins: [ElementPlus,store],
mocks:{
$route: {
query: {
curTab: 'qtype',
tabOperationBeforeType: '5',
tabOperationType: '5',
tableShowMore:10
},
params: {
typeName: 'dnsServiceInsights'
}
}
}
},
propsData: {
timeFilter,
}
})
await new Promise(resolve => setTimeout(() => {
//背景色验证
const percentGreenNode0 = wrapper.find('[test-id="percent-green-0"]')
const percentYellowNode0 = wrapper.find('[test-id="percent-yellow-0"]')
const percentValueNode0 = wrapper.find('[test-id="percent-value-0"]')
const percentGreenNode1 = wrapper.find('[test-id="percent-green-1"]')
const percentYellowNode1 = wrapper.find('[test-id="percent-yellow-1"]')
const percentValueNode1 = wrapper.find('[test-id="percent-value-1"]')
const percentGreenNode2 = wrapper.find('[test-id="percent-green-2"]')
const percentYellowNode2 = wrapper.find('[test-id="percent-yellow-2"]')
const percentValueNode2 = wrapper.find('[test-id="percent-value-2"]')
const percentGreenNode3 = wrapper.find('[test-id="percent-green-3"]')
const percentYellowNode3 = wrapper.find('[test-id="percent-yellow-3"]')
const percentValueNode3 = wrapper.find('[test-id="percent-value-3"]')
const percentGreenNode4 = wrapper.find('[test-id="percent-green-4"]')
const percentYellowNode4 = wrapper.find('[test-id="percent-yellow-4"]')
const percentValueNode4 = wrapper.find('[test-id="percent-value-4"]')
const percentGreenNode5 = wrapper.find('[test-id="percent-green-5"]')
const percentYellowNode5 = wrapper.find('[test-id="percent-yellow-5"]')
const percentValueNode5 = wrapper.find('[test-id="percent-value-5"]')
const percentGreenNode6 = wrapper.find('[test-id="percent-green-6"]')
const percentYellowNode6 = wrapper.find('[test-id="percent-yellow-6"]')
const percentValueNode6 = wrapper.find('[test-id="percent-value-6"]')
const percentGreenNode7 = wrapper.find('[test-id="percent-green-7"]')
const percentYellowNode7 = wrapper.find('[test-id="percent-yellow-7"]')
const percentValueNode7 = wrapper.find('[test-id="percent-value-7"]')
const percentGreenNode8 = wrapper.find('[test-id="percent-green-8"]')
const percentYellowNode8 = wrapper.find('[test-id="percent-yellow-8"]')
const percentValueNode8 = wrapper.find('[test-id="percent-value-8"]')
const percentGreenNode9 = wrapper.find('[test-id="percent-green-9"]')
const percentYellowNode9 = wrapper.find('[test-id="percent-yellow-9"]')
const percentValueNode9 = wrapper.find('[test-id="percent-value-9"]')
expect(percentGreenNode0.element.style.width).toBe('100%')
expect(percentYellowNode0.element.style.width).toBe('0%')
expect(percentValueNode0.text()).toBe('100% / 0%')
expect(percentGreenNode1.element.style.width).toBe('99%')
expect(percentYellowNode1.element.style.width).toBe('1%')
expect(percentValueNode1.text()).toBe('99% / 1%')
expect(percentGreenNode2.element.style.width).toBe('99%')
expect(percentYellowNode2.element.style.width).toBe('1%')
expect(percentValueNode2.text()).toBe('99% / 1%')
expect(percentGreenNode3.element.style.width).toBe('100%')
expect(percentYellowNode3.element.style.width).toBe('0%')
expect(percentValueNode3.text()).toBe('100% / 0%')
expect(percentGreenNode4.element.style.width).toBe('79%')
expect(percentYellowNode4.element.style.width).toBe('21%')
expect(percentValueNode4.text()).toBe('79% / 21%')
expect(percentGreenNode5.element.style.width).toBe('97%')
expect(percentYellowNode5.element.style.width).toBe('3%')
expect(percentValueNode5.text()).toBe('97% / 3%')
expect(percentGreenNode6.element.style.width).toBe('100%')
expect(percentYellowNode6.element.style.width).toBe('0%')
expect(percentValueNode6.text()).toBe('100% / 0%')
expect(percentGreenNode7.element.style.width).toBe('100%')
expect(percentYellowNode7.element.style.width).toBe('0%')
expect(percentValueNode7.text()).toBe('100% / 0%')
expect(percentGreenNode8.element.style.width).toBe('100%')
expect(percentYellowNode8.element.style.width).toBe('0%')
expect(percentValueNode8.text()).toBe('100% / 0%')
expect(percentGreenNode9 === null)
expect(percentYellowNode9 === null)
expect(percentValueNode9 === null)
//})
resolve()
}, 300))
})
test('DNS服务洞察 下钻表格QTypes列 数据转换验证', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
initMuiltUrlData()
// 模拟indexedDB的内容
initIndexedDbData()
// 加载vue组件获得实例
const wrapper = mount(NetworkOverviewTabs, {
global: {
plugins: [ElementPlus,store],
mocks:{
$route: {
query: {
curTab: 'qtype',
tabOperationBeforeType: '5',
tabOperationType: '5',
tableShowMore:10
},
params: {
typeName: 'dnsServiceInsights'
}
}
}
},
propsData: {
timeFilter
}
})
await new Promise(resolve => setTimeout(() => {
//背景色验证
const dnsMapTypeNode0 = wrapper.find('[test-id="dnsMapType-0"]')
const dnsMapTypeNode1 = wrapper.find('[test-id="dnsMapType-1"]')
const dnsMapTypeNode2 = wrapper.find('[test-id="dnsMapType-2"]')
const dnsMapTypeNode3 = wrapper.find('[test-id="dnsMapType-3"]')
const dnsMapTypeNode4 = wrapper.find('[test-id="dnsMapType-4"]')
const dnsMapTypeNode5 = wrapper.find('[test-id="dnsMapType-5"]')
const dnsMapTypeNode6 = wrapper.find('[test-id="dnsMapType-6"]')
const dnsMapTypeNode7 = wrapper.find('[test-id="dnsMapType-7"]')
const dnsMapTypeNode8 = wrapper.find('[test-id="dnsMapType-8"]')
expect(dnsMapTypeNode0.text()).toBe('Reserved')//0
expect(dnsMapTypeNode1.text()).toBe('A')//1
expect(dnsMapTypeNode2.text()).toBe('AAAA')//28
expect(dnsMapTypeNode3.text()).toBe('SRV')//33
expect(dnsMapTypeNode4.text()).toBe('HTTPS')//65
expect(dnsMapTypeNode5.text()).toBe('PTR')//12
expect(dnsMapTypeNode6.text()).toBe('CNAME')//5
expect(dnsMapTypeNode7.text()).toBe('TXT')//2
expect(dnsMapTypeNode8.text()).toBe('NS')//16
resolve()
}, 200))
})
test('DNS服务洞察 下钻表格RCodes列 数据转换验证', async () => {
require('vue-router').useRoute.mockReturnValue({ query: {} })
// 模拟 axios 数据
//axios.get.mockResolvedValue(mockGetDnsRCodes)
initMuiltUrlData()
// 模拟indexedDB的内容
initIndexedDbData()
// 加载vue组件获得实例
const wrapper = mount(NetworkOverviewTabs, {
global: {
plugins: [ElementPlus,store],
mocks:{
$route: {
query: {
curTab: 'rcode',
tabOperationBeforeType: '5',
tabOperationType: '5',
tableShowMore:10
},
params: {
typeName: 'dnsServiceInsights'
}
}
}
},
propsData: {
timeFilter
}
})
await new Promise(resolve => setTimeout(() => {
//背景色验证
const dnsMapTypeNode0 = wrapper.find('[test-id="dnsMapType-0"]')
const dnsMapTypeNode1 = wrapper.find('[test-id="dnsMapType-1"]')
const dnsMapTypeNode2 = wrapper.find('[test-id="dnsMapType-2"]')
const dnsMapTypeNode3 = wrapper.find('[test-id="dnsMapType-3"]')
const dnsMapTypeNode4 = wrapper.find('[test-id="dnsMapType-4"]')
expect(dnsMapTypeNode0.text()).toBe('NoError')//0
expect(dnsMapTypeNode1.text()).toBe('NXDomain')//4
expect(dnsMapTypeNode2.text()).toBe('Refused')//3
expect(dnsMapTypeNode3.text()).toBe('ServFail')//2
expect(dnsMapTypeNode4.text()).toBe('NotImp')//5
resolve()
}, 200))
})
})