1
0
mirror of https://github.com/minio/mc.git synced 2025-07-30 07:23:03 +03:00

Upload results of perf tests to SUBNET (#4254)

This commit is contained in:
Shireesh Anjal
2022-09-27 15:26:43 +05:30
committed by GitHub
parent 698e9ad094
commit ba5f9ac373
6 changed files with 189 additions and 43 deletions

View File

@ -28,7 +28,7 @@ import (
"github.com/minio/mc/pkg/probe"
)
func mainAdminSpeedTestNetperf(ctx *cli.Context, aliasedURL string) error {
func mainAdminSpeedTestNetperf(ctx *cli.Context, aliasedURL string, outCh chan<- PerfTestResult) error {
client, perr := newAdminClient(aliasedURL)
if perr != nil {
fatalIf(perr.Trace(aliasedURL), "Unable to initialize admin client.")
@ -93,18 +93,26 @@ func mainAdminSpeedTestNetperf(ctx *cli.Context, aliasedURL string) error {
for {
select {
case e := <-errorCh:
p.Send(PerfTestResult{
r := PerfTestResult{
Type: NetPerfTest,
Err: e.Error(),
Final: true,
})
}
p.Send(r)
if outCh != nil {
outCh <- r
}
return
case result := <-resultCh:
p.Send(PerfTestResult{
r := PerfTestResult{
Type: NetPerfTest,
NetResult: &result,
Final: true,
})
}
p.Send(r)
if outCh != nil {
outCh <- r
}
return
default:
p.Send(PerfTestResult{