-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
Add Cron Jobs names to New Relic transactions #23784
Add Cron Jobs names to New Relic transactions #23784
Conversation
Hi @lbajsarowicz. Thank you for your contribution
For more details, please, review the Magento Contributor Assistant documentation |
Hi @pmclain, thank you for the review.
|
cc @mpchadwick |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, see review comment and cover changes with automated tests
/** | ||
* Cron Job name pattern for Profiling | ||
*/ | ||
const CRON_TIMERID = 'job %s'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, make const private
* @return void | ||
*/ | ||
private function stopProfiling() | ||
private function stopProfiling(string $jobName = '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find the case when $jobName
may be optional.
* @return void | ||
*/ | ||
private function startProfiling() | ||
private function startProfiling(string $jobName = '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find the case when $jobName may be optional.
*/ | ||
class StatPlugin | ||
{ | ||
const TIMER_NAME_CRON_PREFIX = 'job'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make const private
* @param bool $ignore | ||
* @return void | ||
*/ | ||
public function endTransaction($ignore = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, we are not allowed to add new public methods according to our Backward Compatible Development Guide
Added ugly workaround, checking if any transaction is open - if so, close it with private method. Everything should be removed with 2.4-dev |
Turning down the issue to fix it differently, cleaner way. |
Hi @lbajsarowicz, thank you for your contribution! |
Description (*)
Feature: Add missing transaction names for Cron Jobs in New Relic reports
I've modified private methods, as this is not backward incompatible.
Fixed Issues (if relevant)
Manual testing scenarios (*)
bin/magento cron:run
Contribution checklist (*)