Skip to content

Commit 44daa14

Browse files
committed
250516094504
1 parent 6f9fa1c commit 44daa14

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

mysql-bench.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ RUN_TIME=10 #测试时间
1616
CORES=1 #mysql服务器的并发数 #默认本机核心数
1717

1818
# 全局变量
19-
selfversion='0.1'
19+
selfversion='0.2'
2020
installType='apt -y install'
2121
removeType='apt -y remove'
2222
upgrade="apt -y update"
@@ -215,7 +215,7 @@ echo "--------------------------------------------------------------------------
215215

216216
# 模式列表
217217
modes=("oltp_read_write" "oltp_read_only" "oltp_insert" "oltp_update_non_index")
218-
weights=(80 10 5 5) # 对应上面模式的权重
218+
weights=(80 5 60 50) # 对应上面模式的权重
219219
mode_scores=(0 0 0 0) # 每个模式总得分
220220
mode_counts=(0 0 0 0) # 每个模式测试次数
221221

@@ -244,9 +244,8 @@ while IFS= read -r line; do
244244
done < "$LOG_FILE"
245245

246246
echo
247+
_yellow "得分情况(仅供参考!)"
247248
echo "--------------------------------------------------------------------------"
248-
echo
249-
250249
final_score=0
251250

252251
for i in "${!modes[@]}"; do
@@ -266,10 +265,8 @@ for i in "${!modes[@]}"; do
266265
printf "%-22s 平均分: %-6s 权重: %-2s%% → 加权: %s\n" "$mode" "$avg" "$weight" "$weighted"
267266
final_score=$((final_score + weighted))
268267
done
269-
echo
270268
echo "--------------------------------------------------------------------------"
271-
echo
272-
_green "最终综合得分:$final_score"
269+
_green "总得分:$final_score"
273270

274271

275272
# 脚本退出时清理

0 commit comments

Comments
 (0)