本文整理汇总了PHP中newrelic_set_appname函数的典型用法代码示例。如果您正苦于以下问题:PHP newrelic_set_appname函数的具体用法?PHP newrelic_set_appname怎么用?PHP newrelic_set_appname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了newrelic_set_appname函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setAppName
/**
* Sets the name of the application to string. The string uses the same format as newrelic.appname and can set
* multiple application names by separating each with a semi-colon. The first application name is the primary name,
* and up to two extra application names can be specified. This function should be called as early as possible, and
* will have no effect if called after the RUM footer has been sent. You may want to consider setting the
* application name in a file loaded by PHP's auto_prepend_file INI setting. This function returns true if it
* succeeded or false otherwise.
*
* @param string $name
*
* @return $this
*/
public function setAppName($name)
{
if ($this->active) {
newrelic_set_appname($name);
}
return $this;
}
示例2: setAppName
public function setAppName($name)
{
$this->appname = $name;
if (extension_loaded('newrelic')) {
newrelic_set_appname($name);
}
}
示例3: applicationName
/**
* Change the application name
*
* @param string $name
* @return void
*/
public function applicationName($name)
{
if (!$this->hasNewRelic()) {
return;
}
newrelic_set_appname($name);
}
示例4: setup
/**
* @param string $appName
* @param string|null $license
*/
public static function setup($appName, $license = NULL)
{
if ($license === NULL) {
newrelic_set_appname($appName);
} else {
newrelic_set_appname($appName, $license);
}
}
示例5: setName
/**
* Sets the NewRelic application that should receive this log.
*
* @param $name
* @return $this
*/
public function setName($name)
{
if ($this->isEnabled()) {
newrelic_set_appname($name);
} else {
ini_set('newrelic.appname', $name);
}
$this->name = $name;
return $this;
}
示例6: setConfiguredAppName
/**
* sets the configured app name to newrelic
*/
public function setConfiguredAppName()
{
if (!extension_loaded('newrelic')) {
return;
}
$name = "TYPO3 Portal";
if (isset($this->configuration['appname']) && !empty($this->configuration['appname'])) {
$name = $this->configuration['appname'];
}
newrelic_set_appname($name);
}
示例7: 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);
});
}
}
示例8: set_appname
/**
* Set the application name
*
* @access public
* @return void
*/
public function set_appname()
{
$appname = (string) ee()->config->item('newrelic_app_name');
// -------------------------------------------
// Hidden Configuration Variable
// - newrelic_app_name => Change application name that appears in
// the New Relic dashboard
// -------------------------------------------*/
if (!empty($appname)) {
$appname .= ' - ';
}
newrelic_set_appname($appname . APP_NAME . ' v' . APP_VER);
}
示例9: init
function init()
{
if (defined('DOING_CRON') && DOING_CRON == true) {
if ($this->settingsobj->get_setting('ignore_cron')) {
newrelic_ignore_transaction();
}
}
if (defined('DOING_AJAX') && DOING_AJAX == true) {
newrelic_disable_autorum();
}
if ($this->settingsobj->get_setting('application_id')) {
newrelic_set_appname($this->settingsobj->get_setting('application_id'));
}
if ($this->settingsobj->get_setting('enable_newrelic_errors')) {
}
}
示例10: __construct
/**
* Initialize Newrelic Metric Provider and add it to SugarMetric_Manager listeners chain
*
* @param array $additionalParams
*/
public function __construct(array $additionalParams)
{
if ($this->isLoaded = extension_loaded('newrelic')) {
foreach ($additionalParams as $name => $param) {
switch (strtolower($name)) {
case 'applicationname':
newrelic_set_appname($param);
break;
default:
break;
}
}
} else {
if (isset($GLOBALS['log'])) {
$GLOBALS['log']->debug('SugarMetric_Provider_Newrelic: newrelic php extension is not loaded on server');
}
}
}
示例11: 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);
}
}
示例12: set_appname
/**
* Set the application name
*
* @access public
* @return void
*/
public function set_appname()
{
$appname = (string) ee()->config->item('newrelic_app_name');
// -------------------------------------------
// Hidden Configuration Variable
// - newrelic_app_name => Change application name that appears in
// the New Relic dashboard
// -------------------------------------------*/
if (!empty($appname)) {
$appname .= ' - ';
}
// -------------------------------------------
// Hidden Configuration Variable
// - newrelic_include_version_number => Whether or not to include the version
// number with the application name
// -------------------------------------------*/
$version = ee()->config->item('newrelic_include_version_number') == 'y' ? ' v' . APP_VER : '';
newrelic_set_appname($appname . APP_NAME . $version);
}
示例13: init
/**
* add more info now that we know it
*/
public function init()
{
// set the app name
newrelic_set_appname($this->go_newrelic->get_appname());
// not all versions of the php extension support this method
if (!function_exists('newrelic_set_user_attributes')) {
return;
}
// END if
// see https://newrelic.com/docs/features/browser-traces#set_user_attributes
// for docs on how to use the user info in the transaction trace
if (is_user_logged_in()) {
$user = wp_get_current_user();
newrelic_set_user_attributes($user->ID, '', array_shift($user->roles));
} else {
newrelic_set_user_attributes('not-logged-in', '', 'no-role');
}
// END else
}
示例14: __construct
public function __construct($go_newrelic)
{
// get the calling object
$this->go_newrelic = $go_newrelic;
// can't lazy load the config, we need
$this->config = $this->go_newrelic->config();
// the license key is typically set elsewhere during the daemon/module installation,
// but this allows some potential future where the license key is set in the WP dashboard
if (!empty($this->config['license'])) {
ini_set('newrelic.license', $this->config['license']);
}
// END if
// set the app name
newrelic_set_appname($this->go_newrelic->get_appname());
// basic settings
// make sure the config isn't empty or invalid for any of these
// ...sanity and validation intentionally skipped for performance reasons
ini_set('newrelic.framework', 'wordpress');
ini_set('newrelic.transaction_tracer.detail', $this->config['transaction-tracer-detail']);
ini_set('newrelic.error_collector.enabled', $this->config['error-collector-enabled']);
if (isset($this->config['capture-params']) && $this->config['capture-params']) {
newrelic_capture_params();
}
// END if
ini_set('newrelic.ignored_params', $this->go_newrelic->config('ignored-params'));
// set logging parameters based on request context
// ajax responses _cannot_ have RUM in them, for example
if (is_admin()) {
if (defined('DOING_AJAX') && DOING_AJAX) {
newrelic_disable_autorum();
}
// END if
} elseif (defined('DOING_CRON') && DOING_CRON) {
newrelic_disable_autorum();
} else {
// add more tracking of the template pieces
add_action('template_include', array($this, 'template_include'));
}
// END else
// track the user info
add_action('init', array($this, 'init'));
}
示例15: boot
/**
* Bootstrap the application events.
*
* @return void
*/
public function boot()
{
$this->loadViewsFrom(__DIR__ . '/../resources/views/', 'core');
$this->publishes([__DIR__ . '/../resources/views' => base_path('resources/views/vendor/core'), __DIR__ . '/../resources/views/errors' => base_path('resources/views/errors')], 'views');
// translations
$this->loadTranslationsFrom(__DIR__ . '/../resources/lang', 'core');
/*
|--------------------------------------------------------------------------
| New Relic app name
|--------------------------------------------------------------------------
*/
if (extension_loaded('newrelic')) {
newrelic_set_appname('');
}
/*
|--------------------------------------------------------------------------
| Commands.
|--------------------------------------------------------------------------|
*/
$this->commands('command.install');
$this->commands('command.cachekeyprefix');
$this->commands('command.database');
}