Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update main.go #289

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
13 changes: 6 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,26 +30,25 @@ func main() {
result, err := apinighthawk.NighthawkRun(testConfig)

if err != nil {
msg := "Failed to run load-test"
err = errors.Wrapf(err, msg)
log.Fatal(err)
log.Error("Failed to run load test: ", err)
return
Chadha93 marked this conversation as resolved.
Show resolved Hide resolved
}

var result1 periodic.RunnerResults

err = json.Unmarshal(result, &result1)

if err != nil {
err = errors.Wrap(err, "Error while unmarshaling Nighthawk results to the FortioHTTPRunner")
log.Fatal(err)
log.Error("Error while unmarshaling Nighthawk results to the FortioHTTPRunner: ", err)
return
}

resultsMap := map[string]interface{}{}
err = json.Unmarshal(result, &resultsMap)

if err != nil {
err = errors.Wrap(err, "Error while unmarshaling Nighthawk results to map")
log.Fatal(err)
log.Error("Error while unmarshaling Nighthawk results to map: ", err)
return
}

log.Infof("Mapped version of the test: %+#v", resultsMap)
Expand Down