2
0
mirror of https://github.com/acepanel/panel.git synced 2026-02-04 06:47:20 +08:00

feat: 跑分插件优化

This commit is contained in:
耗子
2024-10-20 01:46:25 +08:00
parent 0d9c8b3a2d
commit 8b6b94ea1f
3 changed files with 24 additions and 20 deletions

View File

@@ -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++ {

View File

@@ -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"

View File

@@ -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 () => {
/ 多核
<n-number-animation :from="0" :to="cpuTotal.multi" show-separator />
</div>
<div v-else>待跑分</div>
<n-progress
type="circle"
:percentage="100"
@@ -193,6 +194,7 @@ const handleTest = async () => {
<div v-if="memory.score !== 0">
<n-number-animation :from="0" :to="memory.score" show-separator />
</div>
<div v-else>待跑分</div>
<n-progress
type="circle"
:percentage="100"
@@ -223,6 +225,7 @@ const handleTest = async () => {
<div v-if="disk.score !== 0">
<n-number-animation :from="0" :to="disk.score" show-separator />
</div>
<div v-else>待跑分</div>
<n-progress
type="circle"
:percentage="100"