diff --git a/cmd/admin-handlers.go b/cmd/admin-handlers.go index bd96238ac..6948ee425 100644 --- a/cmd/admin-handlers.go +++ b/cmd/admin-handlers.go @@ -1494,6 +1494,7 @@ func (a adminAPIHandlers) OBDInfoHandler(w http.ResponseWriter, r *http.Request) if net, ok := vars["perfnet"]; ok && net == "true" && globalIsDistXL { obdInfo.Perf.Net = append(obdInfo.Perf.Net, globalNotificationSys.NetOBDInfo(deadlinedCtx)) obdInfo.Perf.Net = append(obdInfo.Perf.Net, globalNotificationSys.DispatchNetOBDInfo(deadlinedCtx)...) + obdInfo.Perf.NetParallel = globalNotificationSys.NetOBDParallelInfo(deadlinedCtx) partialWrite() } diff --git a/cmd/notification.go b/cmd/notification.go index c29d005bf..e95e31c0c 100644 --- a/cmd/notification.go +++ b/cmd/notification.go @@ -992,6 +992,35 @@ func (sys *NotificationSys) DispatchNetOBDInfo(ctx context.Context) []madmin.Ser return serverNetOBDs } +// NetOBDParallelInfo - Performs NetOBD tests +func (sys *NotificationSys) NetOBDParallelInfo(ctx context.Context) madmin.ServerNetOBDInfo { + netOBDs := []madmin.NetOBDInfo{} + wg := sync.WaitGroup{} + + for index, client := range sys.peerClients { + if client == nil { + continue + } + + wg.Add(1) + go func(index int) { + netOBD, err := sys.peerClients[index].NetOBDInfo(ctx) + netOBD.Addr = sys.peerClients[index].host.String() + if err != nil { + netOBD.Error = err.Error() + } + netOBDs = append(netOBDs, netOBD) + wg.Done() + }(index) + } + wg.Wait() + return madmin.ServerNetOBDInfo{ + Net: netOBDs, + Addr: GetLocalPeer(globalEndpoints), + } + +} + // DriveOBDInfo - Drive OBD information func (sys *NotificationSys) DriveOBDInfo(ctx context.Context) []madmin.ServerDrivesOBDInfo { reply := make([]madmin.ServerDrivesOBDInfo, len(sys.peerClients)) diff --git a/pkg/madmin/obd.go b/pkg/madmin/obd.go index 507eb0b72..81ac9ce29 100644 --- a/pkg/madmin/obd.go +++ b/pkg/madmin/obd.go @@ -131,9 +131,10 @@ type MinioOBDInfo struct { // PerfOBDInfo - Includes Drive and Net perf info for the entire MinIO cluster type PerfOBDInfo struct { - DriveInfo []ServerDrivesOBDInfo `json:"drives,omitempty"` - Net []ServerNetOBDInfo `json:"net,omitempty"` - Error string `json:"error,omitempty"` + DriveInfo []ServerDrivesOBDInfo `json:"drives,omitempty"` + Net []ServerNetOBDInfo `json:"net,omitempty"` + NetParallel ServerNetOBDInfo `json:"net_parallel,omitempty"` + Error string `json:"error,omitempty"` } // ServerDrivesOBDInfo - Drive OBD info about all drives in a single MinIO node