-
Notifications
You must be signed in to change notification settings - Fork 66
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
Release 10.16 #815
Merged
Release 10.16 #815
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Change user-facing documentation links to use `https` instead of `http`
Follows the ideas set out in https://github.com/newrelic/go-agent/pull/828/files --------- Co-authored-by: Hitesh Ahuja <[email protected]>
In PHPs 7.4+ use add_filter wrapper to wrap wordpress hooks callbacks. Older PHPs still use call_user_function_array callback. This approach limits the number of times the agent is called by Zend Engine during WordPress transaction execution because add_filter (and add_action, which is just a wrapper around add_filter) is called less frequently (called when filter is added to a hook) than call_user_function_array (called each time hook executes). The number of times the agent is called by Zend Engine translates to the number of times a wraprec for user function is looked up, and since the agent changed the method how it stores wraprecs in PHPs 7.4+ it is an important optimization. --------- Co-authored-by: Michal Nowacki <[email protected]> Co-authored-by: bduranleau-nr <[email protected]>
`nr_php_wrap_generic_callable` is used to create transient wraprecs for callables which **_don't require to be named_**. This assumption makes it possible to stay DRY and reuse `nr_php_zval_to_function` in lieu of complex pattern matching for the type of callable. This reduces agent's performance overhead as it now uses `nr_php_wrap_callable` always instead of using `nr_php_wrap_user_function_with_transience(IS_TRANSIENT)` sometimes. TL:DR; The agent's performance overhead when `nr_php_wrap_user_function_with_transience(IS_TRANSIENT)` is used comes from the need to walk the linked list of named wraprecs in `nr_php_add_custom_tracer_named`.
Improve agent's performance by figuring out the plugin/theme name at the point an action or filter is added and store it in the wraprec rather than doing it at runtime (which is slow, even with memoization in `wordpress_file_metadata` hashmap).
Improve agent's performance by adding two new toggles around WordPress instrumentation: - `newrelic.framework.wordpress.plugins` - indicates if WordPress hooks callback functions, implemented in WordPress core, plugins and themes, are to be instrumented. - `newrelic.framework.wordpress.hooks_threshold` - sets the WordPress hook's execution duration threshold above which the hook execution will be captured; used when WordPress hooks callback functions are not instrumented. By default, WordPress hooks callback functions are not instrumented and `newrelic.framework.wordpress.hooks_threshold` is set at 1ms. This allows to identify which hooks take up most time during request processing. If more details are needed, i.e. which plugins are the slowest, `newrelic.framework.wordpress.plugins` need to be set to `true`.
Improve agent's performance by adding a new toggle around WordPress instrumentation: * `newrelic.framework.wordpress.core` - indicates if WordPress hooks callback functions, implemented in WordPress core, are to be instrumented. By default WordPress hook callbacks from WordPress core are not instrumented because it increases agent's overhead. It is however possible to enable this instrumentation with INI setting.
Hide boolean flags controling wordpress hooks instrumentation behind a `newrelic.framework.wordpress.hooks.options` facade. The facade makes invalid combinations of boolean flags impossible to set. Additionally do not surprise users with a change to agent behavior. Set the new toggles to values that maintain behavior. This allows for transition period when users can understand the new feature and be prepared for the change.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #815 +/- ##
==========================================
+ Coverage 78.47% 78.74% +0.27%
==========================================
Files 189 189
Lines 26335 26370 +35
==========================================
+ Hits 20666 20766 +100
+ Misses 5669 5604 -65
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
hahuja2
approved these changes
Jan 19, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.