mirror of
https://github.com/oneclickvirt/ecs.git
synced 2025-09-27 03:36:12 +08:00
Compare commits
8 Commits
7bd2b59d58
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
1e88513b8e | ||
![]() |
f84023d18b | ||
![]() |
2cfd5af3c0 | ||
![]() |
ed66e2804a | ||
![]() |
174bf303af | ||
![]() |
b75f42ffe5 | ||
![]() |
56b71ac53f | ||
![]() |
1045d3fab8 |
@@ -47,15 +47,14 @@ Shell 版本:[https://github.com/spiritLHLS/ecs](https://github.com/spiritLHLS
|
||||
|----------------|---------------------------|
|
||||
| Android(arm64) | 存在权限问题未修复,非安卓系统的ARM架构无问题 |
|
||||
| OpenBSD/NetBSD | 部分Goalng的官方库未支持本系统(尤其是net相关项目) |
|
||||
| Windows虚拟机 | 无Admin权限的mbw测试性能不准确(内存测试) |
|
||||
| Windows物理机(非Admin下) | 无Admin权限的mbw测试性能不准确(内存测试) |
|
||||
|
||||
---
|
||||
|
||||
## **功能**
|
||||
|
||||
- 系统基础信息查询,IP基础信息并发查询:[basics](https://github.com/oneclickvirt/basics)、[gostun](https://github.com/oneclickvirt/gostun)
|
||||
- CPU 测试:[cputest](https://github.com/oneclickvirt/cputest),支持 sysbench(lua/golang版本)、geekbench、winsat
|
||||
- 内存测试:[memorytest](https://github.com/oneclickvirt/memorytest),支持 sysbench、dd
|
||||
- 内存测试:[memorytest](https://github.com/oneclickvirt/memorytest),支持 sysbench、dd、winsat、mbw、stream
|
||||
- 硬盘测试:[disktest](https://github.com/oneclickvirt/disktest),支持 dd、fio、winsat
|
||||
- 流媒体解锁信息并发查询:[netflix-verify](https://github.com/sjlleo/netflix-verify) 等逻辑,开发至 [CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests)
|
||||
- 常见流媒体测试并发查询:[UnlockTests](https://github.com/oneclickvirt/UnlockTests),逻辑借鉴 [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) 等
|
||||
|
@@ -47,8 +47,6 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https:
|
||||
|--------|-------------------------------------------------------------------------------------------------|
|
||||
| Android(arm64) | Permission issues that are not fixed, no problems with ARM architecture for non-Android systems |
|
||||
| OpenBSD/NetBSD | Some of Goalng's official libraries do not support this system (especially net-related items) |
|
||||
| Windows(Virtual Machines) | Inaccurate mbw test performance without Admin rights (memory tests) |
|
||||
| Windows(Physical Machines)(not under Admin) | Inaccurate mbw test performance without Admin rights (memory tests) |
|
||||
|
||||
---
|
||||
|
||||
@@ -56,7 +54,7 @@ Shell version: [https://github.com/spiritLHLS/ecs/blob/main/README_EN.md](https:
|
||||
|
||||
- System basic information query and concurrent IP basic information query: Self-developed [basics](https://github.com/oneclickvirt/basics), [gostun](https://github.com/oneclickvirt/gostun)
|
||||
- CPU test: Self-developed [cputest](https://github.com/oneclickvirt/cputest) supporting sysbench(lua/golang version), geekbench, winsat
|
||||
- Memory test: Self-developed [memorytest](https://github.com/oneclickvirt/memorytest) supporting sysbench, dd
|
||||
- Memory test: Self-developed [memorytest](https://github.com/oneclickvirt/memorytest) supporting sysbench, dd, winsat, mbw, stream
|
||||
- Disk test: Self-developed [disktest](https://github.com/oneclickvirt/disktest) supporting dd, fio, winsat
|
||||
- Streaming media unlock information concurrent query: Modified from [netflix-verify](https://github.com/sjlleo/netflix-verify) and more to [CommonMediaTests](https://github.com/oneclickvirt/CommonMediaTests)
|
||||
- Common streaming media tests concurrent query: Self-developed to [UnlockTests](https://github.com/oneclickvirt/UnlockTests), logic modified from [RegionRestrictionCheck](https://github.com/lmc999/RegionRestrictionCheck) and others
|
||||
|
@@ -136,7 +136,8 @@ AMD的7950x单核满血性能得分在6500左右,AMD的5950x单核满血性能
|
||||
|
||||
依赖项目:[https://github.com/oneclickvirt/memorytest](https://github.com/oneclickvirt/memorytest)
|
||||
|
||||
一般来说,只需要判断 IO 速度是否低于 `10240 MB/s (≈10 GB/s)`,
|
||||
一般来说,只需要判断 IO 速度是否低于 `10240 MB/s (≈10 GB/s)`
|
||||
|
||||
如果低于这个值,那么证明内存性能不佳,极大概率存在超售超卖问题。
|
||||
|
||||
至于超开的原因可能是:
|
||||
@@ -160,6 +161,16 @@ AMD的7950x单核满血性能得分在6500左右,AMD的5950x单核满血性能
|
||||
* **20 \~ 40 GB/s (20480 \~ 40960 MB/s)** → 大概率 DDR4
|
||||
* **≈ 50 GB/s (≈ 51200 MB/s)** → 基本就是 DDR5
|
||||
|
||||
对于各种测试参数对应方法的比较:
|
||||
|
||||
| 参数方法 | 测试准确性 | 速度 | 适应架构 | 依赖情况 |
|
||||
|----------|------------|----------|----------|----------|
|
||||
| stream | 高, 结果稳定,更符合实际情况 | 快速 | 跨平台(Linux/Windows/Unix) | 自带依赖无需额外安装 |
|
||||
| sysbench | 高, 结果较可靠 | 中等 | 跨平台(Linux、Windows 部分支持) | 需环境额外安装 |
|
||||
| winsat | 中等偏高, Windows 内置工具 | 中等 | 仅限 Windows | 物理机器上自带,虚拟机不可用 |
|
||||
| mbw | 中等, 结果可能受缓存/调度影响 | 快速 | 跨平台(几乎所有类 Unix 系统) | 自带依赖无需额外安装 |
|
||||
| dd | 低, 结果受缓存影响 | 快速 | 跨平台(几乎所有类 Unix 系统) | 自带依赖无需额外安装 |
|
||||
|
||||
### **硬盘测试**
|
||||
|
||||
依赖项目:[https://github.com/oneclickvirt/disktest](https://github.com/oneclickvirt/disktest)
|
||||
@@ -412,6 +423,7 @@ Actually, CPU performance testing should be sufficient. Unless for scientific co
|
||||
Dependency project: [https://github.com/oneclickvirt/memorytest](https://github.com/oneclickvirt/memorytest)
|
||||
|
||||
Generally speaking, you only need to determine if IO speed is below `10240 MB/s (≈10 GB/s)`.
|
||||
|
||||
If below this value, it proves poor memory performance with high probability of overselling issues.
|
||||
|
||||
Possible reasons for overselling:
|
||||
@@ -435,6 +447,14 @@ Based on the above table, this project's rough judgment method:
|
||||
* **20 ~ 40 GB/s (20480 ~ 40960 MB/s)** → Most likely DDR4
|
||||
* **≈ 50 GB/s (≈ 51200 MB/s)** → Basically DDR5
|
||||
|
||||
| Parameter Method | Test Accuracy | Test Speed | Architecture Compatibility | Dependency Requirements |
|
||||
|----------|------------|----------|----------|----------|
|
||||
| stream | High — Stable results, more realistic | Fast | Cross-platform (Linux/Windows/Unix) | Built-in dependencies, no additional installation required |
|
||||
| sysbench | High — Reliable results | Medium | Cross-platform (Linux, partial Windows support) | Requires additional environment installation |
|
||||
| winsat | Medium-High — Windows built-in tool | Medium | Windows only | Built-in on physical machines, unavailable on virtual machines |
|
||||
| mbw | Medium — Results may be affected by cache/scheduling | Very Fast | Cross-platform (almost all Unix-like systems) | Built-in dependencies, no additional installation required |
|
||||
| dd | Low — Results affected by cache | Fast | Cross-platform (almost all Unix-like systems) | Built-in dependencies, no additional installation required |
|
||||
|
||||
### Disk Testing
|
||||
|
||||
Dependency project: [https://github.com/oneclickvirt/disktest](https://github.com/oneclickvirt/disktest)
|
||||
@@ -633,6 +653,7 @@ AMD 7950xシングルコアフル性能スコアは6500前後、AMD 5950xシン
|
||||
依存プロジェクト:[https://github.com/oneclickvirt/memorytest](https://github.com/oneclickvirt/memorytest)
|
||||
|
||||
一般的に、IO速度が`10240 MB/s (≈10 GB/s)`を下回るかどうかを判断するだけで十分です。
|
||||
|
||||
この値を下回る場合、メモリ性能が不良で、オーバーセリング問題が存在する可能性が極めて高いことを証明します。
|
||||
|
||||
オーバーセリングの原因は以下が考えられます:
|
||||
@@ -656,6 +677,14 @@ AMD 7950xシングルコアフル性能スコアは6500前後、AMD 5950xシン
|
||||
* **20 ~ 40 GB/s (20480 ~ 40960 MB/s)** → 高確率でDDR4
|
||||
* **≈ 50 GB/s (≈ 51200 MB/s)** → 基本的にDDR5
|
||||
|
||||
| パラメータ方法 | テスト精度 | テスト速度 | アーキテクチャ対応 | 依存関係 |
|
||||
|----------|------------|----------|----------|----------|
|
||||
| stream | 高 — 結果が安定し、実際の状況により適合 | 高速 | クロスプラットフォーム(Linux/Windows/Unix) | 内蔵依存関係、追加インストール不要 |
|
||||
| sysbench | 高 — 結果が信頼性高い | 中程度 | クロスプラットフォーム(Linux、Windows部分対応) | 環境への追加インストールが必要 |
|
||||
| winsat | 中程度やや高 — Windows内蔵ツール | 中程度 | Windows限定 | 物理マシンに内蔵、仮想マシンでは利用不可 |
|
||||
| mbw | 中程度 — 結果がキャッシュ/スケジューリングの影響を受ける可能性 | 非常に高速 | クロスプラットフォーム(ほぼ全てのUnix系システム) | 内蔵依存関係、追加インストール不要 |
|
||||
| dd | 低 — 結果がキャッシュの影響を受ける | 高速 | クロスプラットフォーム(ほぼ全てのUnix系システム) | 内蔵依存関係、追加インストール不要 |
|
||||
|
||||
### ディスクテスト
|
||||
|
||||
依存プロジェクト:[https://github.com/oneclickvirt/disktest](https://github.com/oneclickvirt/disktest)
|
||||
|
7
go.mod
7
go.mod
@@ -5,14 +5,14 @@ go 1.24.5
|
||||
require (
|
||||
github.com/imroc/req/v3 v3.54.0
|
||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841
|
||||
github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204
|
||||
github.com/oneclickvirt/UnlockTests v0.0.28-20250924054500
|
||||
github.com/oneclickvirt/backtrace v0.0.7-20250811023541
|
||||
github.com/oneclickvirt/basics v0.0.15-20250812130523
|
||||
github.com/oneclickvirt/cputest v0.0.12-20250720122317
|
||||
github.com/oneclickvirt/defaultset v0.0.2-20240624082446
|
||||
github.com/oneclickvirt/disktest v0.0.10-20250808140407
|
||||
github.com/oneclickvirt/disktest v0.0.10-20250924030424
|
||||
github.com/oneclickvirt/gostun v0.0.5-20250727155022
|
||||
github.com/oneclickvirt/memorytest v0.0.9-20250808065154
|
||||
github.com/oneclickvirt/memorytest v0.0.10-20250924154648
|
||||
github.com/oneclickvirt/nt3 v0.0.8-20250811123903
|
||||
github.com/oneclickvirt/pingtest v0.0.8-20250728015259
|
||||
github.com/oneclickvirt/portchecker v0.0.3-20250728015900
|
||||
@@ -61,6 +61,7 @@ require (
|
||||
github.com/oneclickvirt/dd v0.0.2-20250808062818 // indirect
|
||||
github.com/oneclickvirt/fio v0.0.2-20250808045755 // indirect
|
||||
github.com/oneclickvirt/mbw v0.0.1-20250808061222 // indirect
|
||||
github.com/oneclickvirt/stream v0.0.2-20250924154001 // indirect
|
||||
github.com/oschwald/maxminddb-golang v1.13.1 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 // indirect
|
||||
github.com/pion/dtls/v2 v2.2.7 // indirect
|
||||
|
14
go.sum
14
go.sum
@@ -96,8 +96,8 @@ github.com/nxtrace/NTrace-core v1.4.2 h1:dSRP18Bn3VGf5CZBzKt8gQWW9mDkq62Np9TCF9R
|
||||
github.com/nxtrace/NTrace-core v1.4.2/go.mod h1:wIDOlccuYzY3wBqU89pv2KGHT41i3JA0eRqJU/x9eX4=
|
||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841 h1:Zef93z9UiZQwRAKnnZYALmpBKvvuVaq34MEsuWwk6nc=
|
||||
github.com/oneclickvirt/CommonMediaTests v0.0.4-20250329123841/go.mod h1:DAmFPRjFV5p9fEzUUSml5jJGn2f1NZJQCzTxITHDjc4=
|
||||
github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204 h1:apFaEbHGKflYMZzK17nXzEai4GG873mTd+d9hCO/KdY=
|
||||
github.com/oneclickvirt/UnlockTests v0.0.28-20250727155204/go.mod h1:oOa6wj/qECtRMxwBO6D7o0L0F0Q/5sQ747OCnFQqoGE=
|
||||
github.com/oneclickvirt/UnlockTests v0.0.28-20250924054500 h1:ERFoRBYhTPWJBYhEVFWr3hm6KtSTUHuWD21jK7DhKZw=
|
||||
github.com/oneclickvirt/UnlockTests v0.0.28-20250924054500/go.mod h1:oOa6wj/qECtRMxwBO6D7o0L0F0Q/5sQ747OCnFQqoGE=
|
||||
github.com/oneclickvirt/backtrace v0.0.7-20250811023541 h1:GzkzvUC6U9b6Dkz/Bl4JRPeQ7XBGoW7Qw1aWqzhF+MQ=
|
||||
github.com/oneclickvirt/backtrace v0.0.7-20250811023541/go.mod h1:/+KUtOWz48TyiTTbhVTsp3D6b5WY+4pCgvFBYtUGtns=
|
||||
github.com/oneclickvirt/basics v0.0.15-20250812130523 h1:nPNTVq8d9N1rdshkMAbnhZxTb7L2Yt7NlIg6rY10YRQ=
|
||||
@@ -108,16 +108,16 @@ github.com/oneclickvirt/dd v0.0.2-20250808062818 h1:0KHrKkdpL5oBE1OHsrRd2siRw4/2
|
||||
github.com/oneclickvirt/dd v0.0.2-20250808062818/go.mod h1:tImu9sPTkLWo2tf1dEN1xQzrylWKauj9hbU8PHfyAeU=
|
||||
github.com/oneclickvirt/defaultset v0.0.2-20240624082446 h1:5Pg3mK/u/vQvSz7anu0nxzrNdELi/AcDAU1mMsmPzyc=
|
||||
github.com/oneclickvirt/defaultset v0.0.2-20240624082446/go.mod h1:e9Jt4tf2sbemCtc84/XgKcHy9EZ2jkc5x2sW1NiJS+E=
|
||||
github.com/oneclickvirt/disktest v0.0.10-20250808140407 h1:oUfi5zF3htUTB1ZJuClmK0o74ufP7icbu8LYCnxEOxE=
|
||||
github.com/oneclickvirt/disktest v0.0.10-20250808140407/go.mod h1:Vp3iMVBD4ccReDJz5n5SlzUdq0kDuVhpRklQk21KT+8=
|
||||
github.com/oneclickvirt/disktest v0.0.10-20250924030424 h1:56Aq2xygO/vA/co5vJ7/MQTNijIDl8eYbVk8uCWN4mI=
|
||||
github.com/oneclickvirt/disktest v0.0.10-20250924030424/go.mod h1:Vp3iMVBD4ccReDJz5n5SlzUdq0kDuVhpRklQk21KT+8=
|
||||
github.com/oneclickvirt/fio v0.0.2-20250808045755 h1:eWihCRWcalJjPIdrF8dMe68ZiPnMkSfHC8ENvElp/xE=
|
||||
github.com/oneclickvirt/fio v0.0.2-20250808045755/go.mod h1:NIq+XYTey68KNERGIy/oRDlzpwLzBVoHOCiqX8didsE=
|
||||
github.com/oneclickvirt/gostun v0.0.5-20250727155022 h1:/e3gSUrOp1tg/1NTRx+P8B51OGcP26Q6//5EoSIjOvk=
|
||||
github.com/oneclickvirt/gostun v0.0.5-20250727155022/go.mod h1:pfp7MFZJK9n/KTLAVqqFcCAns4xqMykmjI+1UeF/vdE=
|
||||
github.com/oneclickvirt/mbw v0.0.1-20250808061222 h1:WGXOe6QvHiDRhPVMI0VcctjzW08kGvJf50yq5YeZCtw=
|
||||
github.com/oneclickvirt/mbw v0.0.1-20250808061222/go.mod h1:0Vq6NRpyLmGUdfHfL3uDcFsuZhi7KlG+OCs5ky2757Y=
|
||||
github.com/oneclickvirt/memorytest v0.0.9-20250808065154 h1:mjYOvpFz2mpDU9MNjj66oIDcc2r6+zoW8veP616/+4Q=
|
||||
github.com/oneclickvirt/memorytest v0.0.9-20250808065154/go.mod h1:DBxiVZX7mWCe0Fy+qu57ENheLo00sLfjKzvxiICrUtU=
|
||||
github.com/oneclickvirt/memorytest v0.0.10-20250924154648 h1:trk6oZ7xs1eVtr+6oIv5IX8LDVtEMG+E6GVzQ810BtU=
|
||||
github.com/oneclickvirt/memorytest v0.0.10-20250924154648/go.mod h1:4kiHsEWkW9r3/1ZcV5xIweU0smiKP0IRfQj74AUIiVI=
|
||||
github.com/oneclickvirt/nt3 v0.0.8-20250811123903 h1:ubSPLh/DSrXj+tOgmRABgi2vrVmbmjjSne+NrVFNmNc=
|
||||
github.com/oneclickvirt/nt3 v0.0.8-20250811123903/go.mod h1:F1v+6xInBKnbUa8gV1M40R1HOzxg+obtduNhx3CTnmA=
|
||||
github.com/oneclickvirt/pingtest v0.0.8-20250728015259 h1:egoxZRZBOWN3JqBwqEsULDyRo2/dpGMeWcmV3U87zig=
|
||||
@@ -128,6 +128,8 @@ github.com/oneclickvirt/security v0.0.6-20250823030124 h1:3RjpJNfKV7anN6GJs0ky2B
|
||||
github.com/oneclickvirt/security v0.0.6-20250823030124/go.mod h1:RSMooIlb4H/kLrGWNvUyOgdzQKgYKVv+LzWGlsPsLW4=
|
||||
github.com/oneclickvirt/speedtest v0.0.10-20250728015734 h1:HKO7/JQ74ueXA8Wo8NIvcK9DphbEG/YTfAAVz/akSiY=
|
||||
github.com/oneclickvirt/speedtest v0.0.10-20250728015734/go.mod h1:0W8vnMbA3iucXLXFdGfe9Ia6RPS0izRO7jvu/SnH1P8=
|
||||
github.com/oneclickvirt/stream v0.0.2-20250924154001 h1:GuJWdiPkoK84+y/+oHKr2Ghl3c/MzS9Z5m1nM+lMmy4=
|
||||
github.com/oneclickvirt/stream v0.0.2-20250924154001/go.mod h1:oWaizaHTC2VQciBC9RfaLbAOf8qeR6n20/gY7QxriDE=
|
||||
github.com/oschwald/maxminddb-golang v1.13.1 h1:G3wwjdN9JmIK2o/ermkHM+98oX5fS+k5MbwsmL4MRQE=
|
||||
github.com/oschwald/maxminddb-golang v1.13.1/go.mod h1:K4pgV9N/GcK694KSTmVSDTODk4IsCNThNdTmnaBZ/F8=
|
||||
github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4=
|
||||
|
4
goecs.go
4
goecs.go
@@ -39,7 +39,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
ecsVersion = "v0.1.87"
|
||||
ecsVersion = "v0.1.89"
|
||||
menuMode bool
|
||||
onlyChinaTest bool
|
||||
input, choice string
|
||||
@@ -139,7 +139,7 @@ func parseFlags() {
|
||||
goecsFlag.BoolVar(&speedTestStatus, "speed", true, "Enable/Disable speed test")
|
||||
goecsFlag.StringVar(&cpuTestMethod, "cpum", "sysbench", "Set CPU test method (supported: sysbench, geekbench, winsat)")
|
||||
goecsFlag.StringVar(&cpuTestThreadMode, "cput", "multi", "Set CPU test thread mode (supported: single, multi)")
|
||||
goecsFlag.StringVar(&memoryTestMethod, "memorym", "sysbench", "Set memory test method (supported: sysbench, dd, winsat)")
|
||||
goecsFlag.StringVar(&memoryTestMethod, "memorym", "stream", "Set memory test method (supported: stream, sysbench, dd, winsat, auto)")
|
||||
goecsFlag.StringVar(&diskTestMethod, "diskm", "fio", "Set disk test method (supported: fio, dd, winsat)")
|
||||
goecsFlag.StringVar(&diskTestPath, "diskp", "", "Set disk test path, e.g., -diskp /root")
|
||||
goecsFlag.BoolVar(&diskMultiCheck, "diskmc", false, "Enable/Disable multiple disk checks, e.g., -diskmc=false")
|
||||
|
6
goecs.sh
6
goecs.sh
@@ -152,7 +152,7 @@ goecs_check() {
|
||||
os=$(uname -s 2>/dev/null || echo "Unknown")
|
||||
arch=$(uname -m 2>/dev/null || echo "Unknown")
|
||||
check_china
|
||||
ECS_VERSION="0.1.87"
|
||||
ECS_VERSION="0.1.89"
|
||||
for api in \
|
||||
"https://api.github.com/repos/oneclickvirt/ecs/releases/latest" \
|
||||
"https://githubapi.spiritlhl.workers.dev/repos/oneclickvirt/ecs/releases/latest" \
|
||||
@@ -164,8 +164,8 @@ goecs_check() {
|
||||
sleep 1
|
||||
done
|
||||
if [ -z "$ECS_VERSION" ]; then
|
||||
_yellow "Unable to get version info, using default version 0.1.87"
|
||||
ECS_VERSION="0.1.87"
|
||||
_yellow "Unable to get version info, using default version 0.1.89"
|
||||
ECS_VERSION="0.1.89"
|
||||
fi
|
||||
version_output=""
|
||||
for cmd_path in "goecs" "./goecs" "/usr/bin/goecs" "/usr/local/bin/goecs"; do
|
||||
|
@@ -8,27 +8,78 @@ import (
|
||||
)
|
||||
|
||||
func MemoryTest(language, testMethod string) (realTestMethod, res string) {
|
||||
testMethod = strings.ToLower(testMethod)
|
||||
if testMethod == "" {
|
||||
testMethod = "auto"
|
||||
}
|
||||
if runtime.GOOS == "windows" {
|
||||
if testMethod != "winsat" && testMethod != "" {
|
||||
switch testMethod {
|
||||
case "stream":
|
||||
res = memory.WinsatTest(language)
|
||||
realTestMethod = "winsat"
|
||||
case "dd":
|
||||
res = memory.WindowsDDTest(language)
|
||||
if res == "" || strings.TrimSpace(res) == "" {
|
||||
res += memory.WinsatTest(language)
|
||||
realTestMethod = "winsat"
|
||||
} else {
|
||||
realTestMethod = "dd"
|
||||
}
|
||||
case "sysbench":
|
||||
res = memory.WinsatTest(language)
|
||||
realTestMethod = "winsat"
|
||||
case "auto", "winsat":
|
||||
res = memory.WinsatTest(language)
|
||||
realTestMethod = "winsat"
|
||||
default:
|
||||
res = memory.WinsatTest(language)
|
||||
realTestMethod = "winsat"
|
||||
}
|
||||
res += memory.WinsatTest(language)
|
||||
} else {
|
||||
switch testMethod {
|
||||
case "stream":
|
||||
res = memory.StreamTest(language)
|
||||
if res == "" || strings.TrimSpace(res) == "" {
|
||||
res += memory.DDTest(language)
|
||||
realTestMethod = "dd"
|
||||
} else {
|
||||
realTestMethod = "stream"
|
||||
}
|
||||
case "dd":
|
||||
res = memory.DDTest(language)
|
||||
realTestMethod = "dd"
|
||||
case "sysbench":
|
||||
res = memory.SysBenchTest(language)
|
||||
if res == "" {
|
||||
if res == "" || strings.TrimSpace(res) == "" {
|
||||
res += memory.DDTest(language)
|
||||
realTestMethod = "dd"
|
||||
} else {
|
||||
realTestMethod = "sysbench"
|
||||
}
|
||||
case "dd":
|
||||
case "auto":
|
||||
res = memory.StreamTest(language)
|
||||
if res == "" || strings.TrimSpace(res) == "" {
|
||||
res = memory.DDTest(language)
|
||||
if res == "" || strings.TrimSpace(res) == "" {
|
||||
res = memory.SysBenchTest(language)
|
||||
if res == "" || strings.TrimSpace(res) == "" {
|
||||
realTestMethod = ""
|
||||
} else {
|
||||
realTestMethod = "sysbench"
|
||||
}
|
||||
} else {
|
||||
realTestMethod = "dd"
|
||||
}
|
||||
} else {
|
||||
realTestMethod = "stream"
|
||||
}
|
||||
case "winsat":
|
||||
// winsat 仅 Windows 支持,非 Windows fallback 到 dd
|
||||
res = memory.DDTest(language)
|
||||
realTestMethod = "dd"
|
||||
default:
|
||||
res += memory.DDTest(language)
|
||||
realTestMethod = "dd"
|
||||
res = "Unsupported test method"
|
||||
realTestMethod = ""
|
||||
}
|
||||
}
|
||||
if !strings.Contains(res, "\n") && res != "" {
|
||||
|
@@ -6,6 +6,6 @@ import (
|
||||
)
|
||||
|
||||
func Test(t *testing.T) {
|
||||
_, res := MemoryTest("zh", "sysbench")
|
||||
_, res := MemoryTest("zh", "stream")
|
||||
fmt.Print(res)
|
||||
}
|
||||
|
Reference in New Issue
Block a user