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

responseTime to use request responded. Closes #530 #531

Merged
merged 1 commit into from
Dec 30, 2017
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
3 changes: 1 addition & 2 deletions API.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ Event object associated with the response event option into Good.
- `method` - method used by the request. Maps to `request.method`.
- `path` - incoming path requested. Maps to `request.path`.
- `query` - query object used by request. Maps to `request.query`.
- `responseTime` - calculated value of `Date.now() - request.info.received`.
- `responseSentTime` - calculated value of `request.info.responded - request.info.received`.
- `responseTime` - calculated value of `request.info.responded - request.info.received`.
- `statusCode` - the status code of the response.
- `pid` - the current process id.
- `httpVersion` - the http protocol information from the request.
Expand Down
3 changes: 1 addition & 2 deletions lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,7 @@ class RequestSent {
this.method = request.method;
this.path = request.path;
this.query = request.query;
this.responseTime = Date.now() - request.info.received;
this.responseSentTime = request.info.responded - request.info.received;
this.responseTime = request.info.responded - request.info.received;
this.statusCode = res.statusCode;
this.pid = process.pid;
this.httpVersion = request.raw.req.httpVersion;
Expand Down