-
Notifications
You must be signed in to change notification settings - Fork 983
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
Audit log timer values should accumulate not overwrite #1435
Comments
Hey @lrowe, Could you give some context around why the proposed behavior is desirable? I don't know much about how audit log timers are used. |
@retrohacker I'm using handler timers to provide insight into where time is spent within my endpoint handler (since almost all the cpu time is spent in the endpoint handler rather than middleware.) Let's say I have an expensive function, 'collapse' and I call Ideally each individual time might be logged to an array, though that would involve downstream logging changes. |
Bug Report
Restify Version
5.x
Node.js Version
6.x
Expected behaviour
Audit log timers should accumulate their value when startHandlerTimer/endHandlerTimer is called more than once for the same timer name.
Actual behaviour
Audit log timer is overwritten.
Repro case
See test in #1443.
Cause
node-restify/lib/plugins/audit.js
Lines 85 to 90 in 5169db7
Are you willing and able to fix this?
Yes.
The text was updated successfully, but these errors were encountered: