Last active
August 29, 2015 14:05
-
-
Save fool/68cc95b5e7c303ce6fc2 to your computer and use it in GitHub Desktop.
php script to report a "dummy application" to a list of NR accounts
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
<?php | |
# this script is intended to create an application listing within new relic for a group of accounts. | |
# add license keys here, limit of about 40 to work reliably. | |
$account_list = array( | |
"license key 1", | |
"license key 2", | |
); | |
if (! extension_loaded("newrelic")) { | |
echo "newrelic extension not loaded, so script can't run usefully.\nsee https://docs.newrelic.com/docs/agents/php-agent/troubleshooting/troubleshooting-your-installation"; | |
exit(-1); | |
} else { | |
echo "extension loaded, preparing to report data\n"; | |
} | |
foreach ($account_list as $i) { | |
echo "account: $i\n"; | |
newrelic_name_transaction("test transaction"); | |
newrelic_start_transaction("demo application", "$i"); | |
sleep(2); | |
newrelic_end_transaction(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment