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
Update main.go
Signed-off-by: Shivang Shandilya <[email protected]>
ShivangShandilya authored Apr 11, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit d88af5f6e92f6ebffb132c53770ca21c347ea204
13 changes: 6 additions & 7 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -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)