本文整理汇总了PHP中newrelic_set_appname函数的典型用法代码示例。如果您正苦于以下问题:PHP newrelic_set_appname函数的具体用法?PHP newrelic_set_appname怎么用?PHP newrelic_set_appname使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了newrelic_set_appname函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:spryker,项目名称:NewRelic,代码行数:19,代码来源:NewRelicApi.php
示例2: setAppName
public function setAppName($name)
{
$this->appname = $name;
if (extension_loaded('newrelic')) {
newrelic_set_appname($name);
}
}
开发者ID:catlabinteractive,项目名称:neuron,代码行数:7,代码来源:Tracker.php
示例3: applicationName
/**
* Change the application name
*
* @param string $name
* @return void
*/
public function applicationName($name)
{
if (!$this->hasNewRelic()) {
return;
}
newrelic_set_appname($name);
}
开发者ID:jippi,项目名称:cakephp-newrelic,代码行数:13,代码来源:NewRelic.php
示例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);
}
}
开发者ID:vrtak-cz,项目名称:newrelic-tracy,代码行数:12,代码来源:Bootstrap.php
示例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;
}
开发者ID:sullenboom,项目名称:sla-healthcheck,代码行数:16,代码来源:Handler.php
示例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);
}
开发者ID:AOEpeople,项目名称:TYPO3-Newrelic,代码行数:14,代码来源:Service.php
示例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);
});
}
}
开发者ID:hissy,项目名称:addon_newrelic_apm,代码行数:12,代码来源:controller.php
示例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);
}
开发者ID:nigelpeters,项目名称:css-recruitment-ee,代码行数:19,代码来源:Newrelic.php
示例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')) {
}
}
开发者ID:nullvariable,项目名称:NewRelic-for-WordPress,代码行数:16,代码来源:wpnewrelic.class.php
示例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');
}
}
}
开发者ID:jglaine,项目名称:sugar761-ent,代码行数:23,代码来源:Newrelic.php
示例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);
}
}
开发者ID:hpx2206,项目名称:processmaker-1,代码行数:49,代码来源:sysGeneric.php
示例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);
}
开发者ID:vigm,项目名称:advancedMD,代码行数:25,代码来源:Newrelic.php
示例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
}
开发者ID:petertoi,项目名称:go-newrelic,代码行数:22,代码来源:class-go-newrelic-apm.php
示例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'));
}
开发者ID:nullify005,项目名称:shcc-website,代码行数:42,代码来源:class-go-newrelic-apm.php
示例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');
}
开发者ID:vizo,项目名称:Core,代码行数:28,代码来源:ModuleProvider.php
示例16: ini_set
<?php
/** Production */
ini_set('display_errors', 0);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', false);
/** Disable all file modifications including updates and update notifications */
define('DISALLOW_FILE_MODS', true);
/** new relic */
if (extension_loaded('newrelic')) {
newrelic_set_appname(env('SITENAME'));
}
开发者ID:seafarer,项目名称:bedrock,代码行数:12,代码来源:production.php
示例17: setConfig
public function setConfig()
{
if ($this->getEnabled()) {
newrelic_set_appname($this->_appName);
}
}
开发者ID:cargomedia,项目名称:cm,代码行数:6,代码来源:Newrelic.php
示例18: define
<?php
define('SS_NR_BASE', basename(dirname(__FILE__)));
Config::inst()->update('NewRelicPerformanceReport', 'menu_icon', SS_NR_BASE . '/images/new-relic.png');
//Configure new relic monitoring
if (extension_loaded('newrelic')) {
//Bind to the controller class
Controller::add_extension('NewRelicControllerHook');
//If we have an application name constant ensure New Relic knows what the name is
if (defined('SS_NR_APPLICATION_NAME')) {
newrelic_set_appname(SS_NR_APPLICATION_NAME);
}
//If we're in cli make sure New Relic is aware that we are
if (Director::is_cli()) {
newrelic_background_job(true);
}
//New Relic error binders
if (Director::isLive() || defined('SS_NR_FORCE_ENABLE_LOGGING')) {
SS_Log::add_writer(new NewRelicErrorLogger(), SS_Log::NOTICE);
SS_Log::add_writer(new NewRelicErrorLogger(), SS_Log::WARN);
SS_Log::add_writer(new NewRelicErrorLogger(), SS_Log::ERR);
}
}
开发者ID:webbuilders-group,项目名称:silverstripe-new-relic,代码行数:23,代码来源:_config.php
示例19: list
list($_SERVER['PHP_AUTH_USER'], $_SERVER['PHP_AUTH_PW']) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], 6)));
if (strlen($_SERVER['PHP_AUTH_USER']) == 0 || strlen($_SERVER['PHP_AUTH_PW']) == 0) {
unset($_SERVER['PHP_AUTH_USER']);
unset($_SERVER['PHP_AUTH_PW']);
}
}
}
BasicAuth::protect_entire_site();
}
// CodeEditorField integration
if (class_exists('CodeEditorField')) {
HtmlEditorConfig::get('cms')->enablePlugins(array('aceeditor' => '../../../codeeditorfield/javascript/tinymce/editor_plugin_src.js'));
HtmlEditorConfig::get('cms')->insertButtonsBefore('fullscreen', 'aceeditor');
HtmlEditorConfig::get('cms')->removeButtons('code');
}
if (defined('DEVTOOLKIT_USE_APC') && DEVTOOLKIT_USE_APC) {
SS_Cache::add_backend('two_level', 'Two-Levels', array('slow_backend' => 'File', 'fast_backend' => 'APC', 'slow_backend_options' => array('cache_dir' => TEMP_FOLDER)));
SS_Cache::pick_backend('two_level', 'any', 10);
}
if (defined('DEVTOOLKIT_USE_MEMCACHED') && DEVTOOLKIT_USE_MEMCACHED) {
// Note : this use the Memcache extension, not the Memcached extension
// (with a 'd' - which use libmemcached)
// Install from https://pecl.php.net/package/memcache
// For windows : https://mnshankar.wordpress.com/2011/03/25/memcached-on-64-bit-windows/
SS_Cache::add_backend('two_level', 'Two-Levels', array('slow_backend' => 'File', 'fast_backend' => 'Memcached', 'slow_backend_options' => array('cache_dir' => TEMP_FOLDER), 'fast_backend_options' => array('servers' => array('host' => defined('MEMCACHE_HOST') ? MEMCACHE_HOST : 'localhost', 'port' => defined('MEMCACHE_PORT') ? MEMCACHE_PORT : 11211, 'persistent' => true, 'weight' => 1, 'timeout' => 5, 'retry_interval' => 15, 'status' => true, 'failure_callback' => null))));
SS_Cache::pick_backend('two_level', 'any', 10);
}
// Really basic newrelic integration
if (defined('NEWRELIC_APP_NAME')) {
newrelic_set_appname(NEWRELIC_APP_NAME . ";Silverstripe");
}
开发者ID:lekoala,项目名称:silverstripe-devtoolkit,代码行数:31,代码来源:_config.php
示例20: setAppName
public function setAppName($name)
{
newrelic_set_appname($name);
}
开发者ID:kslimani,项目名称:cerberus,代码行数:4,代码来源:NewRelicHandler.php
注:本文中的newrelic_set_appname函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论