From b7fe13c9f7685d739aef2ea8ceceadd26658221f Mon Sep 17 00:00:00 2001 From: Junyan Qin <1010553892@qq.com> Date: Wed, 18 Oct 2023 04:02:53 +0000 Subject: [PATCH] perf: interval between latency test emission --- web/src/components/Channel.vue | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/web/src/components/Channel.vue b/web/src/components/Channel.vue index e2c86ca..6cb3991 100644 --- a/web/src/components/Channel.vue +++ b/web/src/components/Channel.vue @@ -16,6 +16,7 @@ import { ElNotification } from 'element-plus' const channelList = ref([]); const loading = ref(false); +const scheduling = ref(false); function refreshChannelList() { loading.value = true; @@ -163,9 +164,20 @@ function testChannelLatancy(channel_id) { } function testAllChannelLatancy() { + var interval = 750; + + scheduling.value = true; for (let i = 0; i < channelList.value.length; i++) { - testChannelLatancy(channelList.value[i].id); + + setTimeout(() => { + testChannelLatancy(channelList.value[i].id) + }, i*interval); + } + + setTimeout(() => { + scheduling.value = false; + }, channelList.value.length*interval); } function enableChannel(channel_id) { @@ -448,7 +460,7 @@ function applyChannelDetails() {