Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Add support for request-received middleware #6

Open
niftylettuce opened this issue Jun 13, 2019 · 1 comment
Open

Add support for request-received middleware #6

niftylettuce opened this issue Jun 13, 2019 · 1 comment

Comments

@niftylettuce
Copy link

niftylettuce commented Jun 13, 2019

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 a new Date().

e.g.

req._startTime = new Date();
would change from req._startTime = new Date(); to req._startTime = req[Symbol.for('request-received.startTime')] ? req[Symbol.for('request-received.startTime')] : new Date()

@rochdev
Copy link
Member

rochdev commented Jul 4, 2019

What is the benefit of this approach? Wouldn't putting the Datadog middleware before the logger result in a more precise timing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants