This commit is contained in:
12600k-rog-d4
2026-08-13 22:49:50 +08:00
parent 5e296bfe19
commit 2aaaa16ae2
24 changed files with 1415 additions and 327 deletions

View File

@@ -38,13 +38,17 @@ type SSHConfig struct {
Password string `yaml:"password"`
KeyFile string `yaml:"key"`
Port int `yaml:"port"`
SudoPwd string `yaml:"sudo_password"` // 非 root 用户安装工具时使用的 sudo 密码
}
// StressConfig 压力测试
type StressConfig struct {
Types string `yaml:"types"`
Duration time.Duration `yaml:"duration"`
Threads int `yaml:"threads"`
Types string `yaml:"types"`
Duration time.Duration `yaml:"duration"`
Threads int `yaml:"threads"`
TempLimit float64 `yaml:"temp_limit"` // 温度上限(°C)0=不判定
AutoInstall bool `yaml:"auto_install"` // 缺工具时尝试在线安装apt/dnf/yum 等)
UseMirror bool `yaml:"use_mirror"` // 在线安装时切换国内镜像源(清华 TUNA国内网络卡顿/超时再开启
}
// ReportConfig 报告
@@ -83,9 +87,12 @@ func Default() *Config {
Port: 22,
},
Stress: StressConfig{
Types: "cpu,memory",
Duration: 30 * time.Second,
Threads: 4,
Types: "cpu,memory",
Duration: 30 * time.Second,
Threads: 4,
TempLimit: 90,
AutoInstall: true,
UseMirror: false,
},
Workflow: WorkflowConfig{
Interval: 10 * time.Second,