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 #25957

Conversation

lbajsarowicz
Copy link
Contributor

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 Dec 9, 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.4-develop instance - deploy vanilla Magento instance

For more details, please, review the Magento Contributor Guide documentation.

@magento-engcom-team magento-engcom-team added Partner: Strix partners-contribution Pull Request is created by Magento Partner labels Dec 9, 2019
@ihor-sviziev ihor-sviziev self-assigned this Dec 9, 2019
Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lbajsarowicz,
In general your changes looks good, but would be really good to have some tests for this feature.
Could you cover your changes with some tests?

app/code/Magento/NewRelicReporting/etc/di.xml Outdated Show resolved Hide resolved
@lbajsarowicz
Copy link
Contributor Author

That will, actually, take some time.

*/
private function isCommandSkipped(Command $command): bool
{
return in_array($command->getName(), $this->skipCommands);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like this code will be executed quite often. In array actually is quite slow, could you replace it to finding in map?
Related magento/magento-coding-standard#143

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part is run only for bin/magento commands execution, however - I changed it to avoid in_array

Copy link
Contributor

@ihor-sviziev ihor-sviziev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lbajsarowicz after all your changes - could you squash all changes to single commit, because 18 commits for this small feature is really too much.

@lbajsarowicz lbajsarowicz force-pushed the feature/bic-newrelic-cron-names branch from 42cdc0a to 5819ded Compare December 13, 2019 10:01
@lbajsarowicz
Copy link
Contributor Author

Confirmed that after all the changes feature works as expected:
image

@ihor-sviziev ihor-sviziev added Auto-Tests: Covered All changes in Pull Request is covered by auto-tests Award: test coverage Award: bug fix labels Dec 13, 2019
@magento-engcom-team
Copy link
Contributor

Hi @ihor-sviziev, thank you for the review.
ENGCOM-6461 has been created to process this Pull Request

@engcom-Delta
Copy link
Contributor

✔️ QA passed

@m2-assistant
Copy link

m2-assistant bot commented Dec 29, 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.

@sdzhepa sdzhepa mentioned this pull request May 9, 2022
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.

6 participants