• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP newrelic_add_custom_parameter函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中newrelic_add_custom_parameter函数的典型用法代码示例。如果您正苦于以下问题:PHP newrelic_add_custom_parameter函数的具体用法?PHP newrelic_add_custom_parameter怎么用?PHP newrelic_add_custom_parameter使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了newrelic_add_custom_parameter函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: addCustomParameter

 /**
  * Add a custom parameter to the current web transaction with the specified
  * value.
  *
  * @link https://docs.newrelic.com/docs/agents/php-agent/configuration/php-agent-api#api-custom-param
  *
  * @param string $key
  * @param mixed  $value
  *
  * @return bool
  */
 public function addCustomParameter($key, $value)
 {
     if (!$this->isLoaded()) {
         return false;
     }
     return newrelic_add_custom_parameter($key, $value);
 }
开发者ID:jimmlog,项目名称:php-newrelic,代码行数:18,代码来源:Agent.php


示例2: __construct

 public function __construct($message = "", $code = 0, \Exception $previous = null)
 {
     parent::__construct($message, $code, $previous);
     if (extension_loaded("newrelic")) {
         newrelic_add_custom_parameter("errorDetails: " . $this->getMessage());
     }
 }
开发者ID:stikmanw,项目名称:rest-event-framework,代码行数:7,代码来源:AbstractException.php


示例3: addCustomParameter

 /**
  * Wrapper for 'newrelic_add_custom_parameter' function
  * 
  * @param string $param
  * @param string|int $value
  * @return bool
  */
 public function addCustomParameter($param, $value)
 {
     if (extension_loaded('newrelic')) {
         newrelic_add_custom_parameter($param, $value);
         return true;
     }
     return false;
 }
开发者ID:pradeep-wagento,项目名称:magento2,代码行数:15,代码来源:NewRelicWrapper.php


示例4: onAttributeChange

 /**
  * Record an attribute as Newrelic's custom parameter
  *
  * @param string $key Attribute key
  * @param mixed $value Attribute value
  */
 public function onAttributeChange($key, $value)
 {
     if (function_exists('newrelic_add_custom_parameter')) {
         if (is_bool($value)) {
             $value = $value ? "yes" : "no";
         }
         newrelic_add_custom_parameter($key, $value);
     }
 }
开发者ID:Tjorriemorrie,项目名称:app,代码行数:15,代码来源:TransactionTraceNewrelic.php


示例5: onAfterInit

 /**
  * Set the transaction name to be the controller plus either init-only or index depending on what happened, if this is a page controller set the page link
  */
 public function onAfterInit()
 {
     $controller = get_class($this->owner);
     if ($this->owner->getResponse()->isFinished()) {
         newrelic_name_transaction("{$controller}/init-only");
     } else {
         newrelic_name_transaction("{$controller}/index");
     }
     //Append the page link
     if ($this->owner instanceof Page_Controller) {
         newrelic_add_custom_parameter('ssPageLink', $this->owner->Link());
     }
     //Append the host name for the server
     newrelic_add_custom_parameter('server_name', @gethostname());
 }
开发者ID:webbuilders-group,项目名称:silverstripe-new-relic,代码行数:18,代码来源:NewRelicControllerHook.php


示例6: __destruct

 function __destruct()
 {
     if ($this->transactionName) {
         //Debug::message("newrelic_name_transaction($this->transactionName)");
         if (extension_loaded('newrelic')) {
             newrelic_name_transaction($this->transactionName);
         }
         if ($memberID = Session::get('loggedInAs')) {
             //Debug::message("newrelic_add_custom_parameter('memberID', $memberID)");
             if (extension_loaded('newrelic')) {
                 newrelic_add_custom_parameter('memberID', $memberID);
             }
         }
     }
 }
开发者ID:helpfulrobot,项目名称:silverstripe-newrelic,代码行数:15,代码来源:NewRelicControllerExtension.php


示例7: write

 /**
  * @param array $record
  * @throws Exception\RuntimeException
  */
 public function write(array $record)
 {
     if (!$this->isEnabled()) {
         throw new Exception\RuntimeException('The newrelic PHP extension is required to use the NewRelicHandler');
     }
     if ($name = $this->getName($record['context'])) {
         $this->setName($name);
     }
     if (isset($record['context']['exception']) && $record['context']['exception'] instanceof \Exception) {
         newrelic_notice_error($record['message'], $record['context']['exception']);
         unset($record['context']['exception']);
     } else {
         newrelic_notice_error($record['message']);
     }
     foreach ($record['context'] as $key => $parameter) {
         newrelic_add_custom_parameter($key, $parameter);
     }
 }
开发者ID:sullenboom,项目名称:sla-healthcheck,代码行数:22,代码来源:Handler.php


示例8: transactionLog

/**
 * bootstrap - ProcessMaker Bootstrap
 * this file is used initialize main variables, redirect and dispatch all requests
 */

function transactionLog($transactionName){
    if (extension_loaded('newrelic')) {
        $baseName="ProcessMaker";

        //Application base name
        newrelic_set_appname ($baseName);


        //Custom parameters
        if(defined("SYS_SYS")){
            newrelic_add_custom_parameter ("workspace", SYS_SYS);
        }
        if(defined("SYS_LANG")){
            newrelic_add_custom_parameter ("lang", SYS_LANG);
        }
        if(defined("SYS_SKIN")){
            newrelic_add_custom_parameter ("skin", SYS_SKIN);
        }
        if(defined("SYS_COLLECTION")){
            newrelic_add_custom_parameter ("collection", SYS_COLLECTION);
        }
        if(defined("SYS_TARGET")){
            newrelic_add_custom_parameter ("target", SYS_TARGET);
        }
        if(defined("SYS_URI")){
            newrelic_add_custom_parameter ("uri", SYS_URI);
        }
        if(defined("PATH_CORE")){
            newrelic_add_custom_parameter ("path_core", PATH_CORE);
        }
        if(defined("PATH_DATA_SITE")){
            newrelic_add_custom_parameter ("path_site", PATH_DATA_SITE);
        }

        //Show correct transaction name
        if(defined("SYS_SYS")){
            newrelic_set_appname ("PM-".SYS_SYS.";$baseName");
        }
        if(defined("PATH_CORE")){
            $transactionName=str_replace(PATH_CORE,"",$transactionName);
        }
        newrelic_name_transaction ($transactionName);
    }
}
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:49,代码来源:sysGeneric.php


示例9: write

 /**
  * {@inheritDoc}
  */
 protected function write(array $record)
 {
     if (!$this->isNewRelicEnabled()) {
         throw new ehough_epilog_handler_MissingExtensionException('The newrelic PHP extension is required to use the NewRelicHandler');
     }
     if ($appName = $this->getAppName($record['context'])) {
         $this->setNewRelicAppName($appName);
     }
     if (isset($record['context']['exception']) && $record['context']['exception'] instanceof Exception) {
         newrelic_notice_error($record['message'], $record['context']['exception']);
         unset($record['context']['exception']);
     } else {
         newrelic_notice_error($record['message']);
     }
     foreach ($record['context'] as $key => $parameter) {
         newrelic_add_custom_parameter($key, $parameter);
     }
     foreach ($record['extra'] as $key => $parameter) {
         newrelic_add_custom_parameter($key, $parameter);
     }
 }
开发者ID:ehough,项目名称:epilog,代码行数:24,代码来源:NewRelicHandler.php


示例10: runSync

 public function runSync()
 {
     $helper = Mage::helper('unityreports');
     if (!$helper->isActive()) {
         $helper->debug('Sync is deactivated');
         return false;
     }
     try {
         $client = $this->_getClient();
         //add some tracing
         if (function_exists('newrelic_add_custom_parameter')) {
             newrelic_add_custom_parameter(sync_type, self::ENTITY_TYPE);
             newrelic_add_custom_parameter(sync_max, Intelivemetrics_Unityreports_Model_Utils::getMaxItemsPerSync());
         }
         // get data
         $abcarts = $this->_getData(Intelivemetrics_Unityreports_Model_Utils::getMaxItemsPerSync());
         if (is_null($abcarts)) {
             return self::NOTHING_TO_SYNC;
         }
         //get token
         $response = json_decode($client->getToken($helper->getApiKey(), $helper->getApiSecret(), $helper->getLicenseKey()));
         if ($response->code != 'OK') {
             $helper->debug('Cannot get a valid Token.' . $response->msg);
             return false;
         }
         //see bellow, we don't mark them at this stage, but earlier
         $this->markSentItems($abcarts);
         //send data
         $blob = Intelivemetrics_Unityreports_Model_Utils::prepareDataForSending($abcarts);
         $client->post($response->msg, array('type' => 'SYNC', 'data' => $blob, 'license' => $helper->getLicenseKey(), 'entity' => self::ENTITY_TYPE));
         $helper->debug('Sending ' . count($abcarts) . ' ' . self::ENTITY_TYPE);
         return true;
     } catch (Exception $e) {
         $helper->debug($e, Zend_Log::ERR);
         $helper->debug('FILE: ' . __FILE__ . 'LINE: ' . __LINE__);
         return false;
     }
 }
开发者ID:technomagegithub,项目名称:colb2b,代码行数:38,代码来源:Abcart.php


示例11: runSync

 public function runSync()
 {
     $helper = Mage::helper('unityreports');
     if (!$helper->isActive()) {
         $helper->debug('Sync is deactivated');
         return false;
     }
     try {
         $client = $this->_getClient();
         //add some tracing
         if (function_exists('newrelic_add_custom_parameter')) {
             newrelic_add_custom_parameter('sync_type', $this->_getEntityType());
             newrelic_add_custom_parameter('sync_max', Intelivemetrics_Unityreports_Model_Utils::getMaxItemsPerSync());
         }
         //get data
         $data = $this->_getData(Intelivemetrics_Unityreports_Model_Utils::getMaxItemsPerSync());
         if (is_null($data)) {
             return self::NOTHING_TO_SYNC;
         }
         //get token
         $response = json_decode($client->getToken($helper->getApiKey(), $helper->getApiSecret(), $helper->getLicenseKey()));
         if ($response->code != 'OK') {
             $helper->debug('Cannot get a valid Token.' . $response->msg);
             return false;
         }
         $token = $response->msg;
         //send data
         $blob = Intelivemetrics_Unityreports_Model_Utils::prepareDataForSending($data);
         $response = json_decode($client->post($token, array('type' => 'SYNC', 'data' => $blob, 'license' => $helper->getLicenseKey(), 'entity' => $this->_getEntityType())));
         $helper->debug('Sending ' . count($data) . ' ' . $this->_getEntityType());
         //mark sent items
         if ($response->code == 'OK') {
             $this->markSentItems($data);
         }
         return true;
     } catch (Exception $e) {
         $helper->debug($e, Zend_Log::ERR);
         return false;
     }
 }
开发者ID:technomagegithub,项目名称:colb2b,代码行数:40,代码来源:Sync.php


示例12: get_string

        $pageheading = get_string('addinganewto', 'moodle', $heading);
    } else {
        $pageheading = get_string('addinganew', 'moodle', $fullmodulename);
    }
    $navbaraddition = $pageheading;
} else {
    if (!empty($update)) {
        $url->param('update', $update);
        $PAGE->set_url($url);
        // Select the "Edit settings" from navigation.
        navigation_node::override_active_url(new moodle_url('/course/modedit.php', array('update' => $update, 'return' => 1)));
        // Check the course module exists.
        $cm = get_coursemodule_from_id('', $update, 0, false, MUST_EXIST);
        // eClass Modification.
        if (extension_loaded('newrelic')) {
            newrelic_add_custom_parameter('courseid', $cm->course);
        }
        // Check the course exists.
        $course = $DB->get_record('course', array('id' => $cm->course), '*', MUST_EXIST);
        // require_login
        require_login($course, false, $cm);
        // needed to setup proper $COURSE
        list($cm, $context, $module, $data, $cw) = can_update_moduleinfo($cm);
        $data->coursemodule = $cm->id;
        $data->section = $cw->section;
        // The section number itself - relative!!! (section column in course_sections)
        $data->visible = $cm->visible;
        //??  $cw->visible ? $cm->visible : 0; // section hiding overrides
        $data->cmidnumber = $cm->idnumber;
        // The cm IDnumber
        $data->groupmode = groups_get_activity_groupmode($cm);
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:31,代码来源:modedit.php


示例13: registraParametroTransazione

/**
 * Registra parametro per la transazione su New Relic, se possibile
 * @param string    Nome del parametro
 * @param string    Valore del parametro
 * @return bool     Parametro registrato con successo?
 */
function registraParametroTransazione($nome, $valore)
{
    if (!function_exists('newrelic_add_custom_parameter')) {
        return false;
    }
    newrelic_add_custom_parameter($nome, $valore);
    return true;
}
开发者ID:pizar,项目名称:gaia,代码行数:14,代码来源:pagine.php


示例14: array

 * Authorized file system operations:
 *
 * The Update manager module included with Drupal provides a mechanism for
 * site administrators to securely install missing updates for the site
 * directly through the web user interface by providing either SSH or FTP
 * credentials. This allows the site to update the new files as the user who
 * owns all the Drupal files, instead of as the user the webserver is running
 * as. However, some sites might wish to disable this functionality, and only
 * update the code directly via SSH or FTP themselves. This setting completely
 * disables all functionality related to these authorized file operations.
 *
 * Remove the leading hash signs to disable.
 */
#$conf['allow_authorize_operations'] = FALSE;
$conf['blazedev'] = 0;
#$conf = array('blazedev' => '1');
#variable_set(blazedev, 1);
/**  Added for Memcached configuration */
$conf['cache_backends'][] = './sites/all/modules/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
if (function_exists('newrelic_add_custom_parameter')) {
    if (!empty($_SERVER["HTTP_X_FORWARDED_FOR"])) {
        newrelic_add_custom_parameter('remoteFwdIp', $_SERVER["HTTP_X_FORWARDED_FOR"]);
        newrelic_add_custom_parameter('customerIp', $_SERVER["HTTP_X_FORWARDED_FOR"]);
    } else {
        newrelic_add_custom_parameter('customerIp', $_SERVER["REMOTE_ADDR"]);
    }
    newrelic_add_custom_parameter('remoteIp', $_SERVER["REMOTE_ADDR"]);
    newrelic_add_custom_parameter('requestUri', $_SERVER["REQUEST_URI"]);
}
开发者ID:banderas328,项目名称:default_folder,代码行数:31,代码来源:settings.php


示例15: wpcom_vip_add_URI_to_newrelic

/**
 * Add the exact URI to NewRelic tracking but only if we're not in the admin
 */
function wpcom_vip_add_URI_to_newrelic()
{
    if (!is_admin() && function_exists('newrelic_add_custom_parameter')) {
        newrelic_add_custom_parameter('REQUEST_URI', $_SERVER['REQUEST_URI']);
        newrelic_add_custom_parameter('HTTP_REFERER', $_SERVER['HTTP_REFERER']);
        newrelic_add_custom_parameter('HTTP_USER_AGENT', $_SERVER['HTTP_USER_AGENT']);
    }
}
开发者ID:Automattic,项目名称:vip-mu-plugins-public,代码行数:11,代码来源:vip-utils.php


示例16: addCustomParameter

 /**
  * {@inheritdoc}
  */
 public function addCustomParameter($key, $value)
 {
     if (!$this->extensionLoaded()) {
         return $this;
     }
     newrelic_add_custom_parameter($key, $value);
     return $this;
 }
开发者ID:simplicity-ag,项目名称:NewRelic,代码行数:11,代码来源:Client.php


示例17: addCustomParameter

 /**
  * Adds a custom parameter to current web transaction, e.g. customer's full
  * name.
  *
  * @param string $key Name of custom parameter
  * @param string $value Value of custom parameter
  */
 public function addCustomParameter($key, $value)
 {
     if ($this->skip()) {
         return;
     }
     newrelic_add_custom_parameter($key, $value);
 }
开发者ID:fandikurnia,项目名称:CiiMS,代码行数:14,代码来源:YiiNewRelic.php


示例18: optional_param

 */
require_once '../config.php';
require_once 'lib.php';
require_once 'edit_form.php';
$id = optional_param('id', 0, PARAM_INT);
// Course id.
$categoryid = optional_param('category', 0, PARAM_INT);
// Course category - can be changed in edit form.
$returnto = optional_param('returnto', 0, PARAM_ALPHANUM);
// Generic navigation return page switch.
$PAGE->set_pagelayout('admin');
if ($id) {
    $pageparams = array('id' => $id);
    // eClass Modification.
    if (extension_loaded('newrelic')) {
        newrelic_add_custom_parameter('courseid', $id);
    }
} else {
    $pageparams = array('category' => $categoryid);
}
$PAGE->set_url('/course/edit.php', $pageparams);
// Basic access control checks.
if ($id) {
    // Editing course.
    if ($id == SITEID) {
        // Don't allow editing of  'site course' using this from.
        print_error('cannoteditsiteform');
    }
    // Login to the course and retrieve also all fields defined by course format.
    $course = get_course($id);
    require_login($course);
开发者ID:MoodleMetaData,项目名称:MoodleMetaData,代码行数:31,代码来源:edit.php


示例19: strtolower

$from = $_GET["from"] ?: 'now';
$filter = $_GET["filter"];
$filterstr = $filter ? strtolower($filter) : null;
$onlyVideo = !empty($_REQUEST['video']);
$all = !empty($_REQUEST['all']);
$repeat = !empty($_REQUEST['repeat']);
$nolimit = !empty($_REQUEST['nolimit']);
$csv = !strcasecmp($_GET["f"], 'csv');
if (isset($filterstr) && $supportsGrep) {
    $filterstr = trim(escapeshellarg(str_replace(array('"', "'", '\\'), '', trim($filterstr))), "'\"");
}
if (extension_loaded('newrelic')) {
    newrelic_add_custom_parameter('filter', $filter);
    newrelic_add_custom_parameter('days', $days);
    newrelic_add_custom_parameter('all', $all);
    newrelic_add_custom_parameter('nolimit', $nolimit);
}
$includeip = false;
$includePrivate = false;
if ($admin) {
    $includeip = (int) $_GET["ip"] == 1;
    $includePrivate = (int) $_GET["private"] == 1;
}
function check_it($val)
{
    if ($val) {
        echo ' checked ';
    }
}
if ($csv) {
    header("Content-type: text/csv");
开发者ID:krishnakanthpps,项目名称:webpagetest,代码行数:31,代码来源:testlog.php


示例20: controllerActionPostdispatch

 /**
  * Post dispatch observer for user tracking
  *
  * @access public
  * @param Varien_Event_Observer $observer
  * @return $this
  */
 public function controllerActionPostdispatch($observer)
 {
     if (!$this->_isEnabled()) {
         return $this;
     }
     // Set generic data
     newrelic_add_custom_parameter('magento_controller', Mage::getModel('core/url')->getRequest()->getControllerModule());
     newrelic_add_custom_parameter('magento_request', Mage::getModel('core/url')->getRequest()->getRequestUri());
     newrelic_add_custom_parameter('magento_store_id', Mage::app()->getStore()->getId());
     // Get customer-data
     $customer = Mage::getSingleton('customer/session')->getCustomer();
     $customerName = trim($customer->getName());
     $customerEmail = trim($customer->getEmail());
     // Correct empty values
     if (empty($customerName)) {
         $customerName = 'guest';
     }
     if (empty($customerEmail)) {
         $customerEmail = 'guest';
     }
     // Set customer-data
     newrelic_add_custom_parameter('magento_customer_email', $customerEmail);
     newrelic_add_custom_parameter('magento_customer_name', $customerName);
     // Get and set product-data
     $product = Mage::registry('current_product');
     if (!empty($product)) {
         $productSku = $product->getSku();
         newrelic_add_custom_parameter('magento_product_name', $product->getName());
         newrelic_add_custom_parameter('magento_product_sku', $product->getSku());
         newrelic_add_custom_parameter('magento_product_id', $product->getId());
     } else {
         $productSku = null;
     }
     $category = Mage::registry('current_category');
     if ($category) {
         newrelic_add_custom_parameter('magento_category_name', $category->getName());
         newrelic_add_custom_parameter('magento_category_id', $category->getId());
     }
     // Set user attributes
     if ($this->_getHelper()->isUseRUM()) {
         newrelic_set_user_attributes($customerEmail, $customerName, $productSku);
     }
     return $this;
 }
开发者ID:AleksNesh,项目名称:pandora,代码行数:51,代码来源:Observer.php



注:本文中的newrelic_add_custom_parameter函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP newrelic_add_custom_tracer函数代码示例发布时间:2022-05-15
下一篇:
PHP newinstance函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap