Skip to content

feat: add estimated execution time to function run #81

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

Merged
merged 3 commits into from
Sep 25, 2019
Merged

feat: add estimated execution time to function run #81

merged 3 commits into from
Sep 25, 2019

Conversation

ShelbyZ
Copy link
Contributor

@ShelbyZ ShelbyZ commented Sep 22, 2019

  • use process.hrtime() to track start/stop (supports nodeJS 8.x)
  • debug log estimated execution time in milliseconds

Not sure if requiring debug() is the correct way to report this information. We could also consider displaying a warning/error message if the estimated duration execeeds the defined limit.

Another approach to capturing timing would be to use perf_hooks to setup an observer and add measurements. The observer could process the measurements (logging) and disconnect.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

- use process.hrtime.bigint() to track start/stop
- debug log estimated execution time in milliseconds

Not sure if requiring debug() is the correct way to report this information.  We could also consider displaying a warning/error message if the estimated duration execeeds the defined limit.

Another approach to capturing timing would be to use perf_hooks to setup an observer and add measurements.  The observer could process the measurements (logging) and disconnect.
@ShelbyZ
Copy link
Contributor Author

ShelbyZ commented Sep 23, 2019

Hold off on this for now, I may convert this to use process.hrtime() since node 8.10 does not have process.hrtime.bigint(). and converted.

- fix trying to use process.hrtime.bigint() on nodeJS 6.x
- moving debug statement before error handling/return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants