mirror of
https://github.com/minio/minio.git
synced 2025-01-23 12:43:16 -05:00
Add Parallel NetOBD tests to saturate all nodes at once (#9241)
This commit is contained in:
parent
30707659b5
commit
c8243706b4
@ -1494,6 +1494,7 @@ func (a adminAPIHandlers) OBDInfoHandler(w http.ResponseWriter, r *http.Request)
|
|||||||
if net, ok := vars["perfnet"]; ok && net == "true" && globalIsDistXL {
|
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.NetOBDInfo(deadlinedCtx))
|
||||||
obdInfo.Perf.Net = append(obdInfo.Perf.Net, globalNotificationSys.DispatchNetOBDInfo(deadlinedCtx)...)
|
obdInfo.Perf.Net = append(obdInfo.Perf.Net, globalNotificationSys.DispatchNetOBDInfo(deadlinedCtx)...)
|
||||||
|
obdInfo.Perf.NetParallel = globalNotificationSys.NetOBDParallelInfo(deadlinedCtx)
|
||||||
partialWrite()
|
partialWrite()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -992,6 +992,35 @@ func (sys *NotificationSys) DispatchNetOBDInfo(ctx context.Context) []madmin.Ser
|
|||||||
return serverNetOBDs
|
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
|
// DriveOBDInfo - Drive OBD information
|
||||||
func (sys *NotificationSys) DriveOBDInfo(ctx context.Context) []madmin.ServerDrivesOBDInfo {
|
func (sys *NotificationSys) DriveOBDInfo(ctx context.Context) []madmin.ServerDrivesOBDInfo {
|
||||||
reply := make([]madmin.ServerDrivesOBDInfo, len(sys.peerClients))
|
reply := make([]madmin.ServerDrivesOBDInfo, len(sys.peerClients))
|
||||||
|
@ -131,9 +131,10 @@ type MinioOBDInfo struct {
|
|||||||
|
|
||||||
// PerfOBDInfo - Includes Drive and Net perf info for the entire MinIO cluster
|
// PerfOBDInfo - Includes Drive and Net perf info for the entire MinIO cluster
|
||||||
type PerfOBDInfo struct {
|
type PerfOBDInfo struct {
|
||||||
DriveInfo []ServerDrivesOBDInfo `json:"drives,omitempty"`
|
DriveInfo []ServerDrivesOBDInfo `json:"drives,omitempty"`
|
||||||
Net []ServerNetOBDInfo `json:"net,omitempty"`
|
Net []ServerNetOBDInfo `json:"net,omitempty"`
|
||||||
Error string `json:"error,omitempty"`
|
NetParallel ServerNetOBDInfo `json:"net_parallel,omitempty"`
|
||||||
|
Error string `json:"error,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// ServerDrivesOBDInfo - Drive OBD info about all drives in a single MinIO node
|
// ServerDrivesOBDInfo - Drive OBD info about all drives in a single MinIO node
|
||||||
|
Loading…
x
Reference in New Issue
Block a user