Skip to content

Commit

Permalink
Version 1.0.2
Browse files Browse the repository at this point in the history
Fixed bug where `resp` may be undefined for certain errors.  Thanks to user @DrPennybags for finding this!
  • Loading branch information
jhuckaby committed Sep 4, 2019
1 parent 2bdd641 commit e54ab0c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "wperf",
"version": "1.0.1",
"version": "1.0.2",
"description": "A simple HTTP load testing utility with detailed performance metrics.",
"author": "Joseph Huckaby <jhuckaby@gmail.com>",
"homepage": "https://github.com/jhuckaby/wperf",
Expand Down
4 changes: 2 additions & 2 deletions wperf.js
Expand Up @@ -519,14 +519,14 @@ async.timesLimit( max_iter, max_threads,
num_warns++;
}

if (args.verbose || is_warning) {
if (resp && (args.verbose || is_warning)) {
// In verbose mode, print every success and perf metrics
cli.progress.erase();
cli[is_warning ? 'warn' : 'verbose']( dateTimeStamp() + (is_warning ? bold.red("Perf Warning: ") : '') + 'Req #' + count + ": HTTP " + resp.statusCode + " " + resp.statusMessage + " -- " + JSON.stringify(metrics) + "\n" );
cli.progress.draw();
}

if (is_warning && args.warnings) {
if (resp && is_warning && args.warnings) {
var warn_data = Tools.mergeHashes( metrics, {
code: resp.statusCode,
status: resp.statusMessage,
Expand Down

0 comments on commit e54ab0c

Please sign in to comment.