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

Add report timeout handling #2

Merged
merged 1 commit into from
Jun 26, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var fs = require('fs'),
*
* @type {String[]}
*/
AGGREGATED_FIELDS = ['item', 'request', 'response'],
AGGREGATED_FIELDS = ['item', 'request', 'response', 'requestError'],

IS_NODE_V4 = _(process && process.version).split('.').get(0) === 'v4',

Expand Down
9 changes: 9 additions & 0 deletions lib/template-default.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@
<div class="col-md-4">URL</div><div class="col-md-8"><a href="{{url}}" target="_blank">{{url}}</a></div>
{{/with}}

<div class="col-md-12">&nbsp;</div>
{{#if requestError}}
<div class="col-md-4"><b>Error</b></div><div class="col-md-8"><b>There was an error sending this request</b></div>
<div class="col-md-4"><b>Error code</b></div><div class="col-md-8"><b>{{requestError.code}}</b></div>
{{#if requestError.connect}}
<div class="col-md-4"><b>Details</b></div><div class="col-md-8"><b>A connection to the host could not be established within the stipulated timeout</b></div>
{{/if}}
{{/if}}

<div class="col-md-12">&nbsp;</div>
<div class="col-md-4">Mean time per request</div><div class="col-md-8">{{mean.time}}</div><br/>
<div class="col-md-4">Mean size per request</div><div class="col-md-8">{{mean.size}}</div><br/>
Expand Down