-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3cb0d1b
commit 2cec864
Showing
2 changed files
with
38 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |