From 8b6b94ea1f72912bed1e09e393851158c395ebde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=97=E5=AD=90?= Date: Sun, 20 Oct 2024 01:46:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=B7=91=E5=88=86=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/apps/benchmark/service.go | 4 +-- internal/apps/init.go | 1 + web/src/views/apps/benchmark/IndexView.vue | 39 ++++++++++++---------- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/internal/apps/benchmark/service.go b/internal/apps/benchmark/service.go index 63d5d63f..e71f4c78 100644 --- a/internal/apps/benchmark/service.go +++ b/internal/apps/benchmark/service.go @@ -85,7 +85,7 @@ func (s *Service) calculateCpuScore(duration time.Duration) int { // calculateScore 计算内存/硬盘成绩 func (s *Service) calculateScore(duration time.Duration) int { - score := int((10 / duration.Seconds()) * float64(10000)) + score := int((20 / duration.Seconds()) * float64(30000)) if score < 0 { score = 0 @@ -169,7 +169,7 @@ func (s *Service) machineLearning(multi bool) int { } func (s *Service) machineLearningTask(numThreads int) { - size := 850 + size := 900 a := make([][]float64, size) b := make([][]float64, size) for i := 0; i < size; i++ { diff --git a/internal/apps/init.go b/internal/apps/init.go index ed5afacf..612c5144 100644 --- a/internal/apps/init.go +++ b/internal/apps/init.go @@ -3,6 +3,7 @@ package apps import ( "github.com/go-chi/chi/v5" + _ "github.com/TheTNB/panel/internal/apps/benchmark" _ "github.com/TheTNB/panel/internal/apps/fail2ban" _ "github.com/TheTNB/panel/internal/apps/frp" _ "github.com/TheTNB/panel/internal/apps/gitea" diff --git a/web/src/views/apps/benchmark/IndexView.vue b/web/src/views/apps/benchmark/IndexView.vue index e970e2fe..99045621 100644 --- a/web/src/views/apps/benchmark/IndexView.vue +++ b/web/src/views/apps/benchmark/IndexView.vue @@ -62,35 +62,35 @@ const cpuTotal = computed(() => { const memory = ref({ score: 0, - bandwidth: '无结果', - latency: '无结果' + bandwidth: '待跑分', + latency: '待跑分' }) const disk = ref({ score: 0, 1024: { - read_iops: '无结果', - read_speed: '无结果', - write_iops: '无结果', - write_speed: '无结果' + read_iops: '待跑分', + read_speed: '待跑分', + write_iops: '待跑分', + write_speed: '待跑分' }, 4: { - read_iops: '无结果', - read_speed: '无结果', - write_iops: '无结果', - write_speed: '无结果' + read_iops: '待跑分', + read_speed: '待跑分', + write_iops: '待跑分', + write_speed: '待跑分' }, 512: { - read_iops: '无结果', - read_speed: '无结果', - write_iops: '无结果', - write_speed: '无结果' + read_iops: '待跑分', + read_speed: '待跑分', + write_iops: '待跑分', + write_speed: '待跑分' }, 64: { - read_iops: '无结果', - read_speed: '无结果', - write_iops: '无结果', - write_speed: '无结果' + read_iops: '待跑分', + read_speed: '待跑分', + write_iops: '待跑分', + write_speed: '待跑分' } }) @@ -143,6 +143,7 @@ const handleTest = async () => { / 多核 +
待跑分
{
+
待跑分
{
+
待跑分