Skip to content

Commit

Permalink
fix: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
DonutEspresso committed Oct 30, 2018
1 parent 8a3a2b4 commit 91677d8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/HttpClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,8 @@ function rawRequest(opts, cb) {
clearTimeout(requestTimer);
opts.client._decrementInflightRequests();

// in an error scenario, it's possible the connection died and we were
// in an error scenario, it's possible the connection died and the
// response's `end` event never fired. if that's the case, we were
// never able to set timings/metrics methods on the req object.
if (!req.getTimings || !req.getMetrics) {
eventTimes.endAt = process.hrtime();
Expand All @@ -381,7 +382,7 @@ function rawRequest(opts, cb) {
opts.client.emit('timings', timings);

var metrics = {
statusCode: NaN,
statusCode: null,
method: req.method,
path: opts.path,
url: opts.href,
Expand Down
2 changes: 1 addition & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ describe('restify-client tests', function () {

METRICS_CLIENT_HOST.once('metrics', function (metrics) {
assert.isObject(metrics);
assert.strictEqual(metrics.statusCode.toString(), 'NaN');
assert.strictEqual(metrics.statusCode, null);
assert.strictEqual(metrics.method, 'GET');
assert.strictEqual(metrics.path, '/econnreset');
assert.include(metrics.url, 'http://localhost');
Expand Down

0 comments on commit 91677d8

Please sign in to comment.