Skip to content

Commit

Permalink
Merge bb99748 into 10bc591
Browse files Browse the repository at this point in the history
  • Loading branch information
robertodauria committed Jun 2, 2021
2 parents 10bc591 + bb99748 commit 4619c0d
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 130 deletions.
14 changes: 13 additions & 1 deletion cmd/ndt7-client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ import (
"fmt"
"net"
"os"
"runtime"
"strings"
"time"

Expand All @@ -115,8 +116,9 @@ const (
var (
flagScheme = flagx.Enum{
Options: []string{"wss", "ws"},
Value: "wss",
Value: defaultSchemeForArch(),
}

flagFormat = flagx.Enum{
Options: []string{"human", "json"},
Value: "human",
Expand Down Expand Up @@ -180,6 +182,16 @@ func (r runner) doRunTest(
return 0
}

// defaultSchemeForArch returns the default WebSocket scheme to use, depending
// on the architecture we are running on. A CPU without native AES instructions
// will perform poorly if TLS is enabled.
func defaultSchemeForArch() string {
if runtime.GOARCH == "arm64" || runtime.GOARCH == "amd64" {
return "wss"
}
return "ws"
}

func (r runner) runTest(
ctx context.Context, test spec.TestKind,
start func(context.Context) (<-chan spec.Measurement, error),
Expand Down
8 changes: 5 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ module github.com/m-lab/ndt7-client-go
go 1.13

require (
cloud.google.com/go v0.65.0 // indirect
github.com/apex/log v1.9.0 // indirect
github.com/gocarina/gocsv v0.0.0-20200324105150-9eab084b7a45 // indirect
github.com/google/go-cmp v0.5.1 // indirect
github.com/google/uuid v1.1.2 // indirect
github.com/googleapis/gax-go v1.0.3 // indirect
github.com/gorilla/handlers v1.5.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/justinas/alice v1.2.0 // indirect
Expand All @@ -18,6 +17,9 @@ require (
github.com/m-lab/tcp-info v1.5.2
github.com/m-lab/uuid v0.0.0-20191115203855-549727171666 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
google.golang.org/genproto v0.0.0-20200828030656-73b5761be4c5 // indirect
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 // indirect
golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
google.golang.org/protobuf v1.25.0 // indirect
gopkg.in/square/go-jose.v2 v2.5.1 // indirect
)
Loading

0 comments on commit 4619c0d

Please sign in to comment.