expressjs / expressjs/response-time
Add support for request-received middleware
Open
ideas
- Dominant language
- JavaScript
- Stars
- 497
- Forks
- 74
- PR merge metrics
- No merged PRs in 30d
Description
The `request-received` middleware at https://github.com/cabinjs/request-received exposes a `Symbol.for` property, which this package could conditionally consume if interested (as opposed to just generating `process.hrtime()`.
e.g. https://github.com/expressjs/response-time/blob/master/index.js#L53 would change from `var startAt = process.hrtime()` to `var startAt = req[Symbol.for('request-received.startAt')] ? req[Symbol.for('request-received.startAt')] : process.hrtime()`
Contributor guide
Assessment
This issue has not been assessed yet.