Skip to content
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

Conversation

lbajsarowicz
Copy link
Contributor

@lbajsarowicz lbajsarowicz commented Jul 19, 2019

Description (*)

Feature: Add missing transaction names for Cron Jobs in New Relic reports
image

I've modified private methods, as this is not backward incompatible.

Fixed Issues (if relevant)

Manual testing scenarios (*)

  1. Run bin/magento cron:run
  2. Enjoy the transaction labels for single cron jobs in NewRelic

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Jul 19, 2019

Hi @lbajsarowicz. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.3-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Assistant documentation

@ghost ghost assigned pmclain Jul 24, 2019
@magento-engcom-team
Copy link
Contributor

Hi @pmclain, thank you for the review.
ENGCOM-5488 has been created to process this Pull Request
✳️ @pmclain, could you please add one of the following labels to the Pull Request?

Label Description
Auto-Tests: Covered All changes in Pull Request is covered by auto-tests
Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests
Auto-Tests: Not Required Changes in Pull Request does not require coverage by auto-tests

@pmclain pmclain added Award: bug fix Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests labels Jul 24, 2019
@pmclain
Copy link
Contributor

pmclain commented Jul 24, 2019

cc @mpchadwick

Copy link
Contributor

@sidolov sidolov left a 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';
Copy link
Contributor

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 = '')
Copy link
Contributor

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 = '')
Copy link
Contributor

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';
Copy link
Contributor

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)
Copy link
Contributor

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

@lbajsarowicz
Copy link
Contributor Author

Added ugly workaround, checking if any transaction is open - if so, close it with private method.

Everything should be removed with 2.4-dev

@sidolov sidolov removed the Auto-Tests: Not Covered Changes in Pull Request requires coverage by auto-tests label Sep 3, 2019
@sidolov sidolov added the Auto-Tests: Covered All changes in Pull Request is covered by auto-tests label Sep 3, 2019
@lbajsarowicz
Copy link
Contributor Author

Turning down the issue to fix it differently, cleaner way.

@m2-assistant
Copy link

m2-assistant bot commented Sep 15, 2019

Hi @lbajsarowicz, thank you for your contribution!
Please, complete Contribution Survey, it will take less than a minute.
Your feedback will help us to improve contribution process.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants