You are here

class ExtensionAdapter in New Relic 8

Same name and namespace in other branches
  1. 2.x src/ExtensionAdapter/ExtensionAdapter.php \Drupal\new_relic_rpm\ExtensionAdapter\ExtensionAdapter
  2. 2.0.x src/ExtensionAdapter/ExtensionAdapter.php \Drupal\new_relic_rpm\ExtensionAdapter\ExtensionAdapter

Default new relic adapter.

Hierarchy

Expanded class hierarchy of ExtensionAdapter

File

src/ExtensionAdapter/ExtensionAdapter.php, line 8

Namespace

Drupal\new_relic_rpm\ExtensionAdapter
View source
class ExtensionAdapter implements NewRelicAdapterInterface {

  /**
   * {@inheritdoc}
   */
  public function setTransactionState($state) {
    switch ($state) {
      case static::STATE_BACKGROUND:
        newrelic_background_job(TRUE);
        break;
      case static::STATE_IGNORE:
        newrelic_ignore_transaction(TRUE);
        break;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function logException(\Exception $e) {
    newrelic_notice_error($e);
  }

  /**
   * {@inheritdoc}
   */
  public function logError($message) {
    newrelic_notice_error($message);
  }

  /**
   * {@inheritdoc}
   */
  public function addCustomParameter($key, $value) {
    newrelic_add_custom_parameter($key, $value);
  }

  /**
   * {@inheritdoc}
   */
  public function setTransactionName($name) {
    newrelic_name_transaction($name);
  }

  /**
   * {@inheritdoc}
   */
  public function recordCustomEvent($name, array $attributes) {
    if (function_exists('newrelic_record_custom_event')) {
      newrelic_record_custom_event($name, $attributes);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function disableAutorum() {
    return newrelic_disable_autorum();
  }

}

Members

Namesort descending Modifiers Type Description Overrides
ExtensionAdapter::addCustomParameter public function Adds a custom parameter. Overrides NewRelicAdapterInterface::addCustomParameter
ExtensionAdapter::disableAutorum public function Disable automatic injection of the New Relic Browser snippet. Overrides NewRelicAdapterInterface::disableAutorum
ExtensionAdapter::logError public function Logs an error message. Overrides NewRelicAdapterInterface::logError
ExtensionAdapter::logException public function Logs an exception. Overrides NewRelicAdapterInterface::logException
ExtensionAdapter::recordCustomEvent public function Records a custom event for insights. Overrides NewRelicAdapterInterface::recordCustomEvent
ExtensionAdapter::setTransactionName public function Set the transaction name. Overrides NewRelicAdapterInterface::setTransactionName
ExtensionAdapter::setTransactionState public function Set the new relic transaction state. Overrides NewRelicAdapterInterface::setTransactionState
NewRelicAdapterInterface::STATE_BACKGROUND constant
NewRelicAdapterInterface::STATE_IGNORE constant