Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
spiritLHLS committed May 12, 2024
1 parent 3cb0d1b commit 2cec864
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@
- [x] winstat测试
- [x] dd测试
- [x] fio测试
- [x] 支持双语输出,以```-l```指定zh或en可指定输出的语言,未指定时默认使用中文输出
- [x] 支持双语输出,以```-l```指定```zh``````en```可指定输出的语言,未指定时默认使用中文输出
- [x] 支持单/多盘IO测试,以```-d```指定```single``````multi```可指定是否测试多盘,未指定时默认仅测试单盘```/root``````C:```路径
- [ ] 支持指定路径IO测试,以```-p```指定路径
- [x] 全平台编译支持

## 使用
Expand Down
40 changes: 35 additions & 5 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,16 +1,46 @@
package main

import (
"flag"
"fmt"
"net/http"
"runtime"
"strings"

"github.com/oneclickvirt/diskTest/disktest"
)

func main() {
// res := disktest.WinsatTest("zh", false)
// res := disktest.DDTest("en", true)
res := disktest.FioTest("zh", false)
go func() {
http.Get("https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2Foneclickvirt%2FdiskTest&count_bg=%2379C83D&title_bg=%23555555&icon=&icon_color=%23E7E7E7&title=hits&edge_flat=false")
}()
fmt.Println("项目地址:", "https://github.com/oneclickvirt/diskTest")
languagePtr := flag.String("l", "", "Language parameter (en or zh)")
multiDiskPtr := flag.String("d", "", "Enable multi disk check parameter (single or multi, default is single)")
flag.Parse()
var language, res string
var isMultiCheck bool
if *languagePtr == "" {
language = "zh"
} else {
language = *languagePtr
}
if *multiDiskPtr == "" || *multiDiskPtr == "single" {
isMultiCheck = false
} else if *multiDiskPtr == "multi" {
isMultiCheck = true
}
language = strings.ToLower(language)
if runtime.GOOS == "windows" {
res = disktest.WinsatTest(language, isMultiCheck)
} else {
res = disktest.FioTest(language, isMultiCheck)
if res == "" {
res = disktest.DDTest(language, isMultiCheck)
}
}
fmt.Println("--------------------------------------------------")
fmt.Println(res)
// fio test
// https://github.com/devlights/diskio
fmt.Println("--------------------------------------------------")
// TODO https://github.com/devlights/diskio
}

0 comments on commit 2cec864

Please sign in to comment.