You are here

function new_relic_rpm_cron in New Relic 7

Same name and namespace in other branches
  1. 8 new_relic_rpm.module \new_relic_rpm_cron()
  2. 2.x new_relic_rpm.module \new_relic_rpm_cron()
  3. 2.0.x new_relic_rpm.module \new_relic_rpm_cron()

Implements hook_cron().

This is used to set cron tasks to be not tracked by New Relic if so desired.

File

./new_relic_rpm.module, line 86
Drupal module implementing New Relic.

Code

function new_relic_rpm_cron() {
  if (new_relic_rpm_extension_installed()) {
    $cron_tracking = variable_get('new_relic_rpm_track_cron', 'norm');
    new_relic_rpm_set_job_state($cron_tracking);

    // When using menu items as transaction names, we need to make sure that
    // cron runs still show up as cron.php. Otherwise, the cron runs default to
    // the menu item of the home page.
    if (variable_get('new_relic_rpm_use_menu_item_as_transaction', FALSE)) {
      newrelic_name_transaction('cron.php');
    }
  }
}