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

PHP newrelic_name_transaction函数代码示例

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

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



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

示例1: __invoke

 /**
  * @param \Nette\Application\Application $application
  * @param \Nette\Application\Request $request
  */
 public function __invoke(Application $application, Request $request)
 {
     if (PHP_SAPI === 'cli') {
         newrelic_background_job(TRUE);
     }
     $params = $request->getParameters();
     $action = $request->getPresenterName();
     if (isset($params[$this->actionKey])) {
         $action = sprintf('%s:%s', $action, $params[$this->actionKey]);
     }
     if (!empty($this->map)) {
         foreach ($this->map as $pattern => $appName) {
             if ($pattern === '*') {
                 continue;
             }
             if (Strings::endsWith($pattern, '*')) {
                 $pattern = Strings::substring($pattern, 0, -1);
             }
             if (Strings::startsWith($pattern, ':')) {
                 $pattern = Strings::substring($pattern, 1);
             }
             if (Strings::startsWith($action, $pattern)) {
                 \VrtakCZ\NewRelic\Tracy\Bootstrap::setup($appName, $this->license);
                 break;
             }
         }
     }
     newrelic_name_transaction($action);
     newrelic_disable_autorum();
 }
开发者ID:vrtak-cz,项目名称:newrelic-nette,代码行数:34,代码来源:OnRequestCallback.php


示例2: execute

 /**
  * Execute the action
  * We will build the classname, require the class and call the execute method.
  */
 protected function execute()
 {
     if (extension_loaded('newrelic')) {
         newrelic_background_job();
     }
     $this->loadConfig();
     // build action-class-name
     $actionClass = 'Backend\\Modules\\' . $this->getModule() . '\\Cronjobs\\' . $this->getAction();
     if ($this->getModule() == 'Core') {
         $actionClass = 'Backend\\Core\\Cronjobs\\' . $this->getAction();
     }
     // validate if class exists (aka has correct name)
     if (!class_exists($actionClass)) {
         // set correct headers
         \SpoonHTTP::setHeadersByCode(500);
         // throw exception
         throw new Exception('The cronjobfile is present, but the classname should be: ' . $actionClass . '.');
     }
     // create action-object
     $this->cronjob = new $actionClass($this->getKernel());
     $this->cronjob->setModule($this->getModule());
     $this->cronjob->setAction($this->getAction());
     if (extension_loaded('newrelic')) {
         newrelic_name_transaction('cronjob::' . $this->getModule() . '::' . $this->getAction());
     }
 }
开发者ID:arashrasoulzadeh,项目名称:forkcms,代码行数:30,代码来源:Cronjob.php


示例3: buildTransaction

 /**
  * Build the named transaction based on an array of information from the route hook
  *
  * @param array $page_information the routing information
  *
  * @return void
  */
 protected static function buildTransaction($page_information)
 {
     if (empty($page_information) || !is_array($page_information)) {
         return;
     }
     $transaction = [];
     $identifier = elgg_extract('identifier', $page_information);
     if (!empty($identifier)) {
         $transaction[] = $identifier;
     }
     // filter out usernames
     $usernames = self::getUsernamesToIgnore();
     $segments = elgg_extract('segments', $page_information);
     if (!empty($segments) && is_array($segments)) {
         foreach ($segments as $segment) {
             if (is_numeric($segment) || in_array($segment, $usernames)) {
                 $transaction[] = '*';
                 break;
             } else {
                 $transaction[] = $segment;
             }
         }
     }
     newrelic_name_transaction('/' . implode('/', $transaction));
 }
开发者ID:coldtrick,项目名称:newrelic,代码行数:32,代码来源:Router.php


示例4: route

 public static function route(Request $request)
 {
     $controller = $request->getController() . 'Controller';
     $method = $request->getMethod();
     $args = $request->getArgs();
     //$controllerFile = SITE_PATH.'controllers/'.$controller.'.php';  //***Because autoload
     //if(is_readable($controllerFile)){ //***Because autoload
     //require_once $controllerFile; //***Because autoload
     $controller = new $controller();
     $method = is_callable(array($controller, $method)) ? $method : 'index';
     if (!empty($args)) {
         //call_user_func_array(array($controller,$method),$args);
         if (extension_loaded('newrelic')) {
             newrelic_name_transaction((string) $request->getController() . '/' . (string) $method);
         }
         call_user_func(array($controller, $method), $args);
     } else {
         if (extension_loaded('newrelic')) {
             newrelic_name_transaction((string) $request->getController() . '/' . (string) $method);
         }
         call_user_func(array($controller, $method), NULL);
     }
     return;
     //} //***Because autoload
     throw new Exception('404 - ' . $request->getController() . ' not found');
 }
开发者ID:baconbao,项目名称:BaconBao_MVC_Framework_PHP,代码行数:26,代码来源:Router.class.php


示例5: setNameTransaction

 /**
  * @param $name
  */
 public function setNameTransaction($name)
 {
     $this->debug('Calling setNameTransaction', array($name));
     if ($this->functionExists('newrelic_name_transaction')) {
         newrelic_name_transaction($name);
     }
 }
开发者ID:baisoo,项目名称:Yireo_NewRelic2,代码行数:10,代码来源:Agent.php


示例6: controller_action_predispatch

 /**
  * Hook to record all fron controller events
  * @param Varien_Event_Observer $observer 
  */
 public function controller_action_predispatch(Varien_Event_Observer $observer)
 {
     try {
         if (extension_loaded('newrelic')) {
             $controllerAction = $observer->getControllerAction();
             $request = $controllerAction->getRequest();
             $controllerName = explode("_", $request->getControllerName());
             if (Mage::getStoreConfig('newrelic/settings/ignore_admin_routes') && $request->getRouteName() == 'adminhtml' || $request->getModuleName() == 'admin' || in_array('adminhtml', $controllerName)) {
                 Mage::Helper('newrelic')->setAppName(false);
                 newrelic_ignore_transaction();
                 newrelic_ignore_apdex();
                 return $this;
             }
             if (mage::helper('newrelic')->ignoreModule($request->getModuleName()) === true) {
                 Mage::Helper('newrelic')->setAppName(false);
                 newrelic_ignore_transaction();
                 newrelic_ignore_apdex();
                 return $this;
             }
             if (Mage::getStoreConfig('newrelic/settings/named_transactions')) {
                 $route = $request->getRouteName() . '/' . $request->getControllerName() . '/' . $request->getActionName();
                 if (Mage::getStoreConfig('newrelic/settings/add_module_to_named_transactions')) {
                     $route .= ' (module: ' . $request->getModuleName() . ')';
                 }
                 newrelic_name_transaction($route);
                 Mage::Helper('newrelic')->setAppName(true);
                 return $this;
             }
         }
     } catch (Exception $e) {
         mage::logException($e);
     }
 }
开发者ID:Bobspadger,项目名称:NewRelic,代码行数:37,代码来源:Observer.php


示例7: execute

 /**
  * Execute the action
  * We will build the classname, require the class and call the execute method.
  */
 protected function execute()
 {
     if (extension_loaded('newrelic')) {
         newrelic_background_job();
     }
     $this->loadConfig();
     // build action-class-name
     $actionClass = 'Backend\\Modules\\' . $this->getModule() . '\\Cronjobs\\' . $this->getAction();
     if ($this->getModule() == 'Core') {
         $actionClass = 'Backend\\Core\\Cronjobs\\' . $this->getAction();
     }
     // validate if class exists (aka has correct name)
     if (!class_exists($actionClass)) {
         // set correct headers
         header('HTTP/1.1 500 Internal Server Error');
         // throw exception
         throw new Exception('The cronjobfile ' . $actionClass . ' could not be found.');
     }
     // create action-object
     $this->cronjob = new $actionClass($this->getKernel());
     $this->cronjob->setModule($this->getModule());
     $this->cronjob->setAction($this->getAction());
     if (extension_loaded('newrelic')) {
         newrelic_name_transaction('cronjob::' . $this->getModule() . '::' . $this->getAction());
     }
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:30,代码来源:Cronjob.php


示例8: setNameTransaction

 /**
  * @param string $name
  */
 public function setNameTransaction($name)
 {
     $name = (string) $name;
     if ($this->getEnabled()) {
         newrelic_name_transaction($name);
     }
 }
开发者ID:cargomedia,项目名称:cm,代码行数:10,代码来源:Newrelic.php


示例9: beforeDispatch

 /**
  * beforeDispatch() method.
  *
  * Call the newrelic_name_transaction function when the newrelic extension
  * is loaded.
  *
  * @param Cake\Event\Event $event The event.
  * @return void
  */
 public function beforeDispatch(Event $event)
 {
     if (extension_loaded('newrelic')) {
         $request = $event->data['request'];
         newrelic_name_transaction($this->nameTransaction($request));
     }
 }
开发者ID:brunitto,项目名称:cakephp-new-relic,代码行数:16,代码来源:NameTransactionFilter.php


示例10: handle

 /**
  * Handle an incoming request.
  *
  * @param  \Illuminate\Http\Request $request
  * @param  \Closure $next
  * @return mixed
  */
 public function handle($request, Closure $next)
 {
     if (extension_loaded('newrelic')) {
         newrelic_name_transaction(sprintf('%s (%s)', $request->getRequestUri(), $request->method()));
     }
     return $next($request);
 }
开发者ID:Nebo15,项目名称:gandalf.api,代码行数:14,代码来源:NewRelicMiddleware.php


示例11: nameTransaction

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


示例12: start

 /**
  * Start a New Relic transaction
  *
  * @param  string $name
  * @return void
  */
 public function start($name = null)
 {
     if (!$this->hasNewRelic()) {
         return;
     }
     newrelic_start_transaction(NEW_RELIC_APP_NAME);
     if ($name) {
         $this->currentTransactionName = $name;
     }
     newrelic_name_transaction($this->currentTransactionName);
 }
开发者ID:jippi,项目名称:cakephp-newrelic,代码行数:17,代码来源:NewRelic.php


示例13: __invoke

 /**
  * Invoke
  *
  * @return void
  */
 public function __invoke(Request $request, Response $response, callable $next)
 {
     if (!extension_loaded('newrelic')) {
         $response = $next($request, $response);
         return $response;
     }
     newrelic_name_transaction($request->getRoute()->getPattern());
     newrelic_capture_params(true);
     $response = $next($request, $response);
     return $response;
 }
开发者ID:airtype,项目名称:craft-httpmessagesnewrelicmiddleware,代码行数:16,代码来源:NewRelicMiddleware.php


示例14: on_start

 public function on_start()
 {
     if (extension_loaded('newrelic')) {
         $site = Config::get('newrelic.site') ? Config::get('newrelic.site') : 'concrete5';
         newrelic_set_appname($site);
         Events::addListener('on_page_view', function ($event) {
             $c = $event->getPageObject();
             $path = $c->getCollectionPath() ? $c->getCollectionPath() : '/';
             newrelic_name_transaction($path);
         });
     }
 }
开发者ID:hissy,项目名称:addon_newrelic_apm,代码行数:12,代码来源:controller.php


示例15: name_transaction

 /**
  * Give New Relic a name for this transaction
  *
  * @access	public
  * @return	void
  */
 public function name_transaction()
 {
     $transaction_name = (string) ee()->uri->segment(1);
     if (ee()->uri->segment(2) !== FALSE) {
         $transaction_name .= '/' . ee()->uri->segment(2);
     }
     // Append site label if MSM is enabled to easily differentiate
     // between similar requests
     if (ee()->config->item('multiple_sites_enabled') == 'y') {
         $transaction_name .= ' - ' . ee()->config->item('site_label');
     }
     newrelic_name_transaction($transaction_name);
 }
开发者ID:vigm,项目名称:advancedMD,代码行数:19,代码来源:Newrelic.php


示例16: onRequest

 public function onRequest(Application $app, Request $request)
 {
     if (!extension_loaded('newrelic')) {
         return;
     }
     if (PHP_SAPI === 'cli') {
         newrelic_name_transaction('$ ' . basename($_SERVER['argv'][0]) . ' ' . implode(' ', array_slice($_SERVER['argv'], 1)));
         newrelic_background_job(TRUE);
         return;
     }
     $params = $request->getParameters();
     newrelic_name_transaction($request->getPresenterName() . (isset($params['action']) ? ':' . $params['action'] : ''));
 }
开发者ID:enumag,项目名称:newrelic-nette-1,代码行数:13,代码来源:NewRelicProfilingListener.php


示例17: afterAction

 /**
  * Executed after action
  * @author Adegoke Obasa <[email protected]>
  * @param \yii\base\Action $action
  * @param mixed $result
  * @return mixed
  */
 public function afterAction($action, $result)
 {
     $result = parent::afterAction($action, $result);
     $this->setSecurityHeaders();
     /**
      * Set Current Transaction in New Relic
      * @author Adegoke Obasa <[email protected]>
      */
     if (extension_loaded('newrelic')) {
         newrelic_name_transaction($action->controller->id . '/' . $action->id);
     }
     return $result;
 }
开发者ID:cottacush,项目名称:yii2-base-project,代码行数:20,代码来源:BaseController.php


示例18: __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


示例19: onRequest

 public function onRequest(Application $app, Request $request)
 {
     if (!extension_loaded('newrelic')) {
         return;
     }
     if (PHP_SAPI === 'cli') {
         // uložit v čitelném formátu
         newrelic_name_transaction('$ ' . basename($_SERVER['argv'][0]) . ' ' . implode(' ', array_slice($_SERVER['argv'], 1)));
         // označit jako proces na pozadí
         newrelic_background_job(TRUE);
         return;
     }
     // pojmenování požadavku podle presenteru a akce
     $params = $request->getParameters();
     newrelic_name_transaction($_SERVER['HTTP_HOST'] . " | " . $request->getPresenterName() . (isset($params['action']) ? ':' . $params['action'] : ''));
 }
开发者ID:venca-x,项目名称:nette-newrelic,代码行数:16,代码来源:NewRelicProfilingListener.php


示例20: nameTransaction

 /**
  * Makes a more useful name for the transaction
  */
 public function nameTransaction()
 {
     // Add the first and second segements
     $name = craft()->request->getSegment(1);
     if (craft()->request->getSegment(2)) {
         $name .= "/" . craft()->request->getSegment(2);
     }
     // If it was a live preview request then prepend a label for that
     if (craft()->request->isLivePreview()) {
         $name = "/LivePreview/{$name}";
     } elseif (craft()->request->isCpRequest()) {
         $name = craft()->config->get('cpTrigger') . "/{$name}";
     }
     // Add the transaction through the PHP agenet API
     newrelic_name_transaction($name);
 }
开发者ID:astoltz,项目名称:Craft-New-Relic,代码行数:19,代码来源:NewRelicService.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP newrelic_notice_error函数代码示例发布时间:2022-05-15
下一篇:
PHP newrelic_disable_autorum函数代码示例发布时间: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