Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ import (
)

type Result struct {
ConnectionEstablishedSeconds float64 `json:"connectionEstablishedSeconds"`
UploadSeconds float64 `json:"uploadSeconds"`
DownloadSeconds float64 `json:"downloadSeconds"`
Latency float64 `json:"latency"`
}

func RunClient(addr string, uploadBytes, downloadBytes uint64) error {
Expand All @@ -35,7 +33,6 @@ func RunClient(addr string, uploadBytes, downloadBytes uint64) error {
if err != nil {
return err
}
connectionEstablishmentTook := time.Since(start)
str, err := conn.OpenStream()
if err != nil {
return err
Expand All @@ -47,9 +44,7 @@ func RunClient(addr string, uploadBytes, downloadBytes uint64) error {
log.Printf("uploaded %s: %.2fs (%s/s)", formatBytes(uploadBytes), uploadTook.Seconds(), formatBytes(bandwidth(uploadBytes, uploadTook)))
log.Printf("downloaded %s: %.2fs (%s/s)", formatBytes(downloadBytes), downloadTook.Seconds(), formatBytes(bandwidth(downloadBytes, downloadTook)))
json, err := json.Marshal(Result{
ConnectionEstablishedSeconds: connectionEstablishmentTook.Seconds(),
UploadSeconds: uploadTook.Seconds(),
DownloadSeconds: downloadTook.Seconds(),
Latency: time.Since(start).Seconds(),
})
if err != nil {
return err
Expand Down