Added autotune support to speedtest (#1239)

- Also updated tooltip trigger icon size

Signed-off-by: Benjamin Perez <benjamin@bexsoft.net>

Co-authored-by: Benjamin Perez <benjamin@bexsoft.net>
This commit is contained in:
Alex
2021-11-19 02:08:33 -06:00
committed by GitHub
parent 7f5de2d70e
commit 6bacd0a45c
19 changed files with 383 additions and 320 deletions

View File

@@ -89,6 +89,12 @@ func getSpeedtestOptionsFromReq(req *http.Request) (*madmin.SpeedtestOpts, error
optionsSet.Concurrency = concurrent
autotune := queryPairs.Get("autotune")
if autotune == "true" {
optionsSet.Autotune = true
}
return &optionsSet, nil
}

View File

@@ -116,6 +116,10 @@ func (c wsConn) readMessage() (messageType int, p []byte, err error) {
// on the path.
// Request should come like ws://<host>:<port>/ws/<api>
func serveWS(w http.ResponseWriter, req *http.Request) {
upgrader.CheckOrigin = func(r *http.Request) bool {
return true
}
// Perform authentication before upgrading to a Websocket Connection
// authenticate WS connection with Console
session, err := auth.GetClaimsFromTokenInRequest(req)
@@ -215,7 +219,7 @@ func serveWS(w http.ResponseWriter, req *http.Request) {
}
go wsS3Client.watch(wOptions)
case strings.HasPrefix(wsPath, `/speedtest`):
fmt.Println("Speedtest triggered")
fmt.Println("Speedtest init")
speedtestOpts, err := getSpeedtestOptionsFromReq(req)
if err != nil {