Get speedtest results as part of support diag (#4034)
Also remove the `--full` flag and run the new perf tests (that run quite fast) always (if the minio version supports it). In case of older versions of minio that have the older versions of the performance tests, mc will not request for those tests to be run, and subsequently will not look for their results in the response.
This commit is contained in:
+35
-23
@@ -47,7 +47,7 @@ import (
|
||||
var supportDiagFlags = append([]cli.Flag{
|
||||
HealthDataTypeFlag{
|
||||
Name: "test",
|
||||
Usage: "choose specific diagnostics to run [" + fullOptions.String() + "]",
|
||||
Usage: "choose specific diagnostics to run [" + options.String() + "]",
|
||||
Value: nil,
|
||||
Hidden: true,
|
||||
},
|
||||
@@ -62,11 +62,6 @@ var supportDiagFlags = append([]cli.Flag{
|
||||
Usage: "SUBNET license key",
|
||||
Hidden: true, // deprecated dec 2021
|
||||
},
|
||||
cli.BoolFlag{
|
||||
Name: "full",
|
||||
Usage: "include long running diagnostics (takes longer to generate the report)",
|
||||
Hidden: false,
|
||||
},
|
||||
}, subnetCommonFlags...)
|
||||
|
||||
var supportDiagCmd = cli.Command{
|
||||
@@ -344,12 +339,7 @@ func subnetUploadReq(url string, filename string) (*http.Request, error) {
|
||||
func fetchServerDiagInfo(ctx *cli.Context, client *madmin.AdminClient) (interface{}, string, error) {
|
||||
opts := GetHealthDataTypeSlice(ctx, "test")
|
||||
if len(*opts) == 0 {
|
||||
full := ctx.Bool("full")
|
||||
if full {
|
||||
opts = &fullOptions
|
||||
} else {
|
||||
opts = &liteOptions
|
||||
}
|
||||
opts = &options
|
||||
}
|
||||
|
||||
optsMap := make(map[madmin.HealthDataType]struct{})
|
||||
@@ -439,21 +429,32 @@ func fetchServerDiagInfo(ctx *cli.Context, client *madmin.AdminClient) (interfac
|
||||
config := spinner("Server Config", madmin.HealthDataTypeMinioConfig)
|
||||
drive := spinner("Drive Test", madmin.HealthDataTypePerfDrive)
|
||||
net := spinner("Network Test", madmin.HealthDataTypePerfNet)
|
||||
obj := spinner("Objects Test", madmin.HealthDataTypePerfObj)
|
||||
syserr := spinner("System Errors", madmin.HealthDataTypeSysErrors)
|
||||
syssrv := spinner("System Services", madmin.HealthDataTypeSysServices)
|
||||
sysconfig := spinner("System Config", madmin.HealthDataTypeSysConfig)
|
||||
|
||||
progressV0 := func(info madmin.HealthInfoV0) {
|
||||
noOfServers := len(info.Sys.CPUInfo)
|
||||
_ = admin(len(info.Minio.Info.Servers) > 0) &&
|
||||
cpu(len(info.Sys.CPUInfo) > 0) &&
|
||||
diskHw(len(info.Sys.DiskHwInfo) > 0) &&
|
||||
osInfo(len(info.Sys.OsInfo) > 0) &&
|
||||
mem(len(info.Sys.MemInfo) > 0) &&
|
||||
process(len(info.Sys.ProcInfo) > 0) &&
|
||||
config(info.Minio.Config != nil) &&
|
||||
drive(len(info.Perf.DriveInfo) > 0) &&
|
||||
net(noOfServers == 1 || (len(info.Perf.Net) > 1 && len(info.Perf.NetParallel.Addr) > 0))
|
||||
config(info.Minio.Config != nil)
|
||||
}
|
||||
|
||||
progressV2 := func(info madmin.HealthInfoV2) {
|
||||
_ = cpu(len(info.Sys.CPUInfo) > 0) &&
|
||||
diskHw(len(info.Sys.Partitions) > 0) &&
|
||||
osInfo(len(info.Sys.OSInfo) > 0) &&
|
||||
mem(len(info.Sys.MemInfo) > 0) &&
|
||||
process(len(info.Sys.ProcInfo) > 0) &&
|
||||
config(info.Minio.Config.Config != nil) &&
|
||||
syserr(len(info.Sys.SysErrs) > 0) &&
|
||||
syssrv(len(info.Sys.SysServices) > 0) &&
|
||||
sysconfig(len(info.Sys.SysConfig) > 0) &&
|
||||
admin(len(info.Minio.Info.Servers) > 0)
|
||||
}
|
||||
|
||||
progress := func(info madmin.HealthInfo) {
|
||||
@@ -464,8 +465,9 @@ func fetchServerDiagInfo(ctx *cli.Context, client *madmin.AdminClient) (interfac
|
||||
mem(len(info.Sys.MemInfo) > 0) &&
|
||||
process(len(info.Sys.ProcInfo) > 0) &&
|
||||
config(info.Minio.Config.Config != nil) &&
|
||||
drive(len(info.Perf.Drives) > 0) &&
|
||||
net(noOfServers == 1 || (len(info.Perf.Net) > 1 && len(info.Perf.NetParallel.Addr) > 0)) &&
|
||||
drive(len(info.Perf.DrivePerf) > 0) &&
|
||||
obj(len(info.Perf.ObjPerf) > 0) &&
|
||||
net(noOfServers == 1 || len(info.Perf.NetPerf) > 0) &&
|
||||
syserr(len(info.Sys.SysErrs) > 0) &&
|
||||
syssrv(len(info.Sys.SysServices) > 0) &&
|
||||
sysconfig(len(info.Sys.SysConfig) > 0) &&
|
||||
@@ -509,7 +511,20 @@ func fetchServerDiagInfo(ctx *cli.Context, client *madmin.AdminClient) (interfac
|
||||
|
||||
healthInfo = MapHealthInfoToV1(info, nil)
|
||||
version = madmin.HealthInfoVersion1
|
||||
case madmin.HealthInfoVersion2:
|
||||
info := madmin.HealthInfoV2{}
|
||||
for {
|
||||
if err = decoder.Decode(&info); err != nil {
|
||||
if errors.Is(err, io.EOF) {
|
||||
err = nil
|
||||
}
|
||||
|
||||
break
|
||||
}
|
||||
|
||||
progressV2(info)
|
||||
}
|
||||
healthInfo = info
|
||||
case madmin.HealthInfoVersion:
|
||||
info := madmin.HealthInfo{}
|
||||
for {
|
||||
@@ -540,7 +555,7 @@ func (d *HealthDataTypeSlice) Set(value string) error {
|
||||
if obdData, ok := madmin.HealthDataTypesMap[strings.Trim(v, " ")]; ok {
|
||||
*d = append(*d, obdData)
|
||||
} else {
|
||||
return fmt.Errorf("valid options include %s", fullOptions.String())
|
||||
return fmt.Errorf("valid options include %s", options.String())
|
||||
}
|
||||
}
|
||||
return nil
|
||||
@@ -642,7 +657,4 @@ func (f HealthDataTypeFlag) ApplyWithError(set *flag.FlagSet) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
var (
|
||||
liteOptions = HealthDataTypeSlice(madmin.HealthDataTypesLite)
|
||||
fullOptions = HealthDataTypeSlice(madmin.HealthDataTypesList)
|
||||
)
|
||||
var options = HealthDataTypeSlice(madmin.HealthDataTypesList)
|
||||
|
||||
@@ -20,7 +20,7 @@ require (
|
||||
github.com/minio/cli v1.22.0
|
||||
github.com/minio/colorjson v1.0.1
|
||||
github.com/minio/filepath v1.0.0
|
||||
github.com/minio/madmin-go v1.3.5
|
||||
github.com/minio/madmin-go v1.3.8
|
||||
github.com/minio/md5-simd v1.1.2 // indirect
|
||||
github.com/minio/minio-go/v7 v7.0.23
|
||||
github.com/minio/pkg v1.1.14
|
||||
|
||||
@@ -294,8 +294,8 @@ github.com/minio/colorjson v1.0.1 h1:+hvfP8C1iMB95AT+ZFDRE+Knn9QPd9lg0CRJY9DRpos
|
||||
github.com/minio/colorjson v1.0.1/go.mod h1:oPM3zQQY8Gz9NGtgvuBEjQ+gPZLKAGc7T+kjMlwtOgs=
|
||||
github.com/minio/filepath v1.0.0 h1:fvkJu1+6X+ECRA6G3+JJETj4QeAYO9sV43I79H8ubDY=
|
||||
github.com/minio/filepath v1.0.0/go.mod h1:/nRZA2ldl5z6jT9/KQuvZcQlxZIMQoFFQPvEXx9T/Bw=
|
||||
github.com/minio/madmin-go v1.3.5 h1:YbDc4Q1oAjeGCss1u4j29kVgwJDLzoohgIGebAaLBXc=
|
||||
github.com/minio/madmin-go v1.3.5/go.mod h1:vGKGboQgGIWx4DuDUaXixjlIEZOCIp6ivJkQoiVaACc=
|
||||
github.com/minio/madmin-go v1.3.8 h1:sL0vTRKoGi0bjAKa2f4+RsM4eFdH+uKQCe7k4E2tyjk=
|
||||
github.com/minio/madmin-go v1.3.8/go.mod h1:vGKGboQgGIWx4DuDUaXixjlIEZOCIp6ivJkQoiVaACc=
|
||||
github.com/minio/md5-simd v1.1.0/go.mod h1:XpBqgZULrMYD3R+M28PcmP0CkI7PEMzB3U77ZrKZ0Gw=
|
||||
github.com/minio/md5-simd v1.1.2 h1:Gdi1DZK69+ZVMoNHRXJyNcxrMA4dSxoYHZSQbirFg34=
|
||||
github.com/minio/md5-simd v1.1.2/go.mod h1:MzdKDxYpY2BT9XQFocsiZf/NKVtR7nkE4RoEpN+20RM=
|
||||
|
||||
Reference in New Issue
Block a user