Skip to content
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
}

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