当前位置: 首页>>代码示例>>PHP>>正文


PHP newrelic_name_transaction函数代码示例

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


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


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