add some metrics to the "hooks_type_test" module #3554
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I found "hooks_type_test" very usefull and added some metrics to evaluate the performance of the various modules on a runnning system.
I don't know all the usages of "hooks_type_test", but here is how I use it, maybe helpfull for others ?
I generally grab some hook call with redbug :
then define the args of the trace
To feed in the associated hook method in hooks_type_test to get some execution timings:
I may be wrong, but I don't think this module is used in some specific context,
thus it should be possible to modifiy the return values without breaking anything.
If I'm wrong the durations may be rather sent to the console to restore the former return value.
I kept the previous version with all the explicit method calls as commented out code.
Here is a sample of the generated code:
Always run metrics twice, sometimes you may measure without/with caching ;-)