Skip to content

Instantly share code, notes, and snippets.

@fool
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fool/68cc95b5e7c303ce6fc2 to your computer and use it in GitHub Desktop.
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
<?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