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

@ -46,7 +46,7 @@ func mainAdminSpeedtest(ctx *cli.Context) error {
return nil
}
func mainAdminSpeedTestObject(ctx *cli.Context, aliasedURL string) error {
func mainAdminSpeedTestObject(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.")
@ -135,11 +135,15 @@ func mainAdminSpeedTestObject(ctx *cli.Context, aliasedURL string) error {
go func() {
if e != nil {
p.Send(PerfTestResult{
r := PerfTestResult{
Type: ObjectPerfTest,
Err: e.Error(),
Final: true,
})
}
p.Send(r)
if outCh != nil {
outCh <- r
}
return
}
@ -150,11 +154,15 @@ func mainAdminSpeedTestObject(ctx *cli.Context, aliasedURL string) error {
ObjectResult: &result,
})
}
p.Send(PerfTestResult{
r := PerfTestResult{
Type: ObjectPerfTest,
ObjectResult: &result,
Final: true,
})
}
p.Send(r)
if outCh != nil {
outCh <- r
}
}()
<-done